-
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.
- Loading branch information
Henri Devigne
committed
Jun 2, 2024
1 parent
aee8624
commit 3a56ce7
Showing
14 changed files
with
131 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,10 +21,15 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
- uses: ./.github/actions/generate-icons | ||
with: | ||
upload_artifact: false | ||
|
||
- name: Super-linter | ||
uses: super-linter/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
VALIDATE_GO_MODULES: false # @see https://github.com/cratonica/2goarray/issues/14 | ||
commitlint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
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) | ||
} | ||
} |