Harden CI and release artifacts

This commit is contained in:
2026-08-11 23:15:18 +09:00
parent ed2ba07ce1
commit a0750e4d5f
8 changed files with 107 additions and 39 deletions

View File

@@ -14,6 +14,10 @@ fi
if [ -z "$version" ]; then
version="dev"
fi
if [[ "$version" != "dev" && ! "$version" =~ ^v[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z.-]+)?$ ]]; then
echo "invalid release version: $version" >&2
exit 1
fi
rm -rf dist
mkdir -p dist
@@ -40,7 +44,7 @@ for target in "${targets[@]}"; do
CGO_ENABLED=0 GOOS="$goos" GOARCH="$goarch" go build \
-trimpath \
-ldflags="-s -w" \
-ldflags="-s -w -X main.buildVersion=$version" \
-o "$workdir/$binary" \
./cmd/dataxl
@@ -56,3 +60,4 @@ for target in "${targets[@]}"; do
done
(cd dist && sha256sum dataxl_* > checksums.txt)
(cd dist && sha256sum -c checksums.txt)