-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from henri9813/feat-support-windows
Feat support windows
- Loading branch information
Showing
14 changed files
with
130 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: "Generate icons" | ||
description: "Generate icons and push it as an artifact" | ||
|
||
inputs: | ||
upload_artifact: | ||
description: 'Upload artifact' | ||
default: 'true' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.22' | ||
- name: Compiled icons | ||
shell: bash | ||
run: | | ||
GOPATH=$(go env GOPATH) | ||
export GOPATH | ||
go get github.com/cratonica/2goarray | ||
go install github.com/cratonica/2goarray | ||
./generate-icons.sh | ||
- uses: actions/upload-artifact@v4 | ||
if: ${{ inputs.upload_artifact == 'true' }} | ||
with: | ||
name: icons | ||
path: icons/*.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
vendor | ||
vendor | ||
icons/*.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
set -x | ||
|
||
for icon in icons/*.ico; do | ||
icon_name=$(basename "${icon%.*}") | ||
capitalized_name=$(echo "${icon_name:0:1}" | tr '[:lower:]' '[:upper:]')${icon_name:1} | ||
"${GOPATH}/bin/2goarray" "${capitalized_name}" icons <"${icon}" >"icons/${icon_name}.go" | ||
done |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package main | ||
|
||
import ( | ||
"runtime" | ||
|
||
probing "github.com/prometheus-community/pro-bing" | ||
) | ||
|
||
var pinger *probing.Pinger | ||
|
||
func init() { | ||
var err error | ||
pinger, err = probing.NewPinger("8.8.8.8") | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
pinger.SetLogger(nil) | ||
|
||
if runtime.GOOS == "windows" { | ||
pinger.SetPrivileged(true) | ||
} | ||
} |