-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
5 changed files
with
88 additions
and
0 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,23 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.22" | ||
|
||
- name: chkfmt | ||
run: scripts/chkfmt | ||
|
||
- name: xbuild | ||
run: scripts/xbuild | ||
|
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 @@ | ||
/zfind | ||
/dist |
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,10 @@ | ||
#!/bin/bash | ||
set -eE -o pipefail | ||
|
||
res="$(gofmt -l . 2>&1)" | ||
|
||
if [ -n "$res" ]; then | ||
echo "gofmt check failed:" | ||
echo "${res}" | ||
exit 1 | ||
fi |
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,46 @@ | ||
#!/bin/bash | ||
set -eE -o pipefail | ||
|
||
if [ -z "$version" ]; then | ||
version=$(git rev-parse HEAD) | ||
fi | ||
|
||
mkdir -p dist | ||
rm -f dist/* | ||
|
||
build() { | ||
echo "- $1-$2" | ||
rm -f dist/zfind | ||
CGO_ENABLED=0 GOOS="$1" GOARCH="$2" go build -o dist -ldflags="-X main.appVersion=$version" ./cmd/zfind | ||
|
||
pushd dist | ||
|
||
case "$1" in | ||
windows) | ||
outfile="zfind-$1-$2.zip" | ||
zip "$outfile" zfind.exe --move | ||
;; | ||
*) | ||
outfile="zfind-$1-$2.tar.gz" | ||
tar -czf "$outfile" zfind --remove-files | ||
;; | ||
esac | ||
|
||
popd | ||
} | ||
|
||
build android arm64 | ||
build darwin amd64 | ||
build darwin arm64 | ||
build freebsd amd64 | ||
build freebsd arm64 | ||
build freebsd riscv64 | ||
build linux amd64 | ||
build linux arm64 | ||
build linux riscv64 | ||
build netbsd amd64 | ||
build netbsd arm64 | ||
build openbsd amd64 | ||
build openbsd arm64 | ||
build windows amd64 | ||
build windows arm64 |