ci: fix host-mode docker go invocation
All checks were successful
CI / Test, vet, build (push) Successful in 51s

This commit is contained in:
Maxfield Luke 2026-07-29 05:00:12 -04:00
parent 4ab64d501e
commit 71c0d89102
3 changed files with 39 additions and 60 deletions

29
scripts/ci-release.sh Executable file
View file

@ -0,0 +1,29 @@
#!/bin/sh
# Build multi-arch release archives for tarakan-client. Used by Forgejo Actions.
set -eu
version="${VERSION:-dev}"
mkdir -p dist staging
targets="linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 windows/amd64 windows/arm64"
for target in $targets; do
goos=${target%/*}
goarch=${target#*/}
archive="tarakan_${version}_${goos}_${goarch}"
package="staging/${archive}"
mkdir -p "${package}"
binary="tarakan"
if [ "$goos" = "windows" ]; then
binary="tarakan.exe"
fi
version_ld=${version#v}
CGO_ENABLED=0 GOOS="$goos" GOARCH="$goarch" \
go build -trimpath -ldflags="-s -w -X main.version=${version_ld}" \
-o "${package}/${binary}" ./cmd/tarakan
cp LICENSE "${package}/"
if [ "$goos" = "windows" ]; then
(cd staging && zip -q -r "../dist/${archive}.zip" "${archive}")
else
tar -C staging -czf "dist/${archive}.tar.gz" "${archive}"
fi
done
(cd dist && sha256sum tarakan_* > checksums.txt)
ls -la dist/