@@ -166,14 +166,36 @@ jobs:
166166 sed -i "s|^LIBBPF_HEADERS_SHA256=.*|LIBBPF_HEADERS_SHA256=${hsum}|" build/versions.env
167167 grep -E '_SHA256_|^LIBBPF_HEADERS_SHA256=' build/versions.env
168168
169+ - name : Tag immutable v${{ env.TC }} snapshot
170+ run : |
171+ set -euo pipefail
172+ tag="v${TC}"
173+ # master is protected (PR/merge-queue only), so we never push it. The
174+ # recorded lock (bumped version + checksums) and the SDK headers land
175+ # in the commit the version tag points at, so the tag is fully
176+ # self-contained: `git show ${tag}:build/versions.env` yields the exact
177+ # lock for this release. Binaries are NOT committed — they ride the
178+ # release as assets (x86_64/ and aarch64/ are gitignored).
179+ if git ls-remote --exit-code --tags origin "refs/tags/${tag}" >/dev/null 2>&1; then
180+ echo "tag ${tag} already exists — leaving the immutable tag as-is"
181+ else
182+ git config user.name "github-actions[bot]"
183+ git config user.email "github-actions[bot]@users.noreply.github.com"
184+ git add include build/versions.env
185+ git commit -m "toolchain ${tag}: record version, checksums + headers"
186+ git tag -a "$tag" -m "Static build toolchain ${tag}"
187+ git push origin "refs/tags/${tag}"
188+ fi
189+
169190 - name : Publish v${{ env.TC }} release
170191 env :
171192 GH_TOKEN : ${{ github.token }}
172193 run : |
173194 set -euo pipefail
174195 tag="v${TC}"
175- # Immutable, version-tagged release; the tag carries the version, so
176- # assets are plain-named (<tool>-<arch>). Consumers pin this one tag.
196+ # Immutable, version-tagged release pinned to the snapshot tag above;
197+ # the tag carries the version, so assets are plain-named (<tool>-<arch>).
198+ # Consumers pin this one tag.
177199 mkdir -p dist
178200 for a in x86_64 aarch64; do
179201 for t in clang make bpftool esbuild git; do cp "$a/$t" "dist/${t}-${a}"; done
@@ -184,20 +206,3 @@ jobs:
184206 --notes "Static build toolchain $tag — clang/make/git built from source; bpftool/esbuild/libbpf headers re-hosted."
185207 # --clobber so a same-version re-run refreshes assets.
186208 gh release upload "$tag" dist/* --clobber
187-
188- - name : Commit headers + recorded checksums
189- run : |
190- set -euo pipefail
191- # Binaries are NOT committed — they are published as release assets
192- # above and fetched into the per-machine cache. Only the SDK headers
193- # and the recorded checksums land in git (x86_64/ and aarch64/ are
194- # gitignored).
195- git config user.name "github-actions[bot]"
196- git config user.email "github-actions[bot]@users.noreply.github.com"
197- git add include build/versions.env
198- if git diff --cached --quiet; then
199- echo "no changes to commit"
200- else
201- git commit -m "toolchain v${TC}: record version, checksums + headers"
202- git push
203- fi
0 commit comments