ci: Gitea Actions workflows for CI and tagged releases; strip option (M7)
CI / test (push) Canceled after 0s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Daniel SamsonandClaude Sonnet 5.5 committed 2026-10-17 13:53:12 +01:00
1 parent c5faf8a682
commit b022dcf32b
5 files changed
+130

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
#!/bin/sh
# Install the Zig toolchain used by CI into ${ZIG_DIR:-$HOME/.cache/zag-ci/zig} and print its bin dir.
# Skips the download when the right version is already there.
set -eu
VERSION=0.16.0
DIR=${ZIG_DIR:-$HOME/.cache/zag-ci/zig-$VERSION}
case "$(uname -s)-$(uname -m)" in
Linux-x86_64) target=x86_64-linux; sha=70e49664a74374b48b51e6f3fdfbf437f6395d42509050588bd49abe52ba3d00 ;;
Linux-aarch64 | Linux-arm64) target=aarch64-linux; sha=ea4b09bfb22ec6f6c6ceac57ab63efb6b46e17ab08d21f69f3a48b38e1534f17 ;;
Darwin-arm64) target=aarch64-macos; sha=b23d70deaa879b5c2d486ed3316f7eaa53e84acf6fc9cc747de152450d401489 ;;
Darwin-x86_64) target=x86_64-macos; sha=0387557ed1877bc6a2e1802c8391953baddba76081876301c522f52977b52ba7 ;;
*) echo "unsupported runner: $(uname -s)-$(uname -m)" >&2; exit 1 ;;
esac
if [ ! -x "$DIR/zig" ] || [ "$("$DIR/zig" version 2>/dev/null)" != "$VERSION" ]; then
tmp=$(mktemp -d)
archive="zig-$target-$VERSION.tar.xz"
curl -fsSL -o "$tmp/$archive" "https://ziglang.org/download/$VERSION/$archive"
echo "$sha $tmp/$archive" | (sha256sum -c - 2>/dev/null || shasum -a 256 -c -) >&2
mkdir -p "$DIR"
tar -xJf "$tmp/$archive" -C "$DIR" --strip-components=1
rm -rf "$tmp"
fi
echo "$DIR"