Skip to content

ci(release): self-contained archives + harden the release path#55

Merged
helly25 merged 1 commit into
mainfrom
release/self-contained-and-harden
Jun 20, 2026
Merged

ci(release): self-contained archives + harden the release path#55
helly25 merged 1 commit into
mainfrom
release/self-contained-and-harden

Conversation

@helly25

@helly25 helly25 commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Adapts the remaining release-process fixes from mbo's path to a working 0.11.1 release. The BCR auto-publish half (mbo #191) already landed on main via #54, so this PR is the rest (mbo #194 + #196).

The core bug (why prior releases would ship broken)

release_prep.sh applied .github/workflows/bazelmod.patch to the worktree (commenting out the dev-only include("//bazelmod:...") lines) and generated the empty root BUILD.bazel — but then ran git archive "${TAG}", which archives the committed tree and silently dropped both edits. So every release tarball shipped with the dev includes active and wouldn't build standalone (and the separate .bcr patch then double-commented at BCR-publish time).

Fix: archive the patched worktree via a throwaway index (GIT_INDEX_FILEgit read-tree / git add --all / git write-tree), leaving the real index/checkout untouched. export-ignore still applies via the staged .gitattributes + --worktree-attributes.

Verified locally: the produced proto-1.2.1.tar.gz has MODULE.bazel with the includes commented, an empty root BUILD.bazel, dev dirs (.github/.bcr/tools) export-ignored, and VERSION + sources present.

Changes

  • release_prep.sh — self-contained archive (throwaway-index), as above.
  • Deleted .bcr/patches/bazelmod.patch + its bcr-bazelmod-patch-applies pre-commit hook — the tarball is now self-contained, so publish-to-bcr needs no patch (removes the stale-patch failure mode).
  • trigger_release.sh — require running on main at exactly origin/main; validate numeric X.Y.Z; portable BSD/GNU sed for the version bump + CHANGELOG prepend; pre-flight that .github/workflows/bazelmod.patch still applies. Simple flow kept: open the version-bump PR and stop — another maintainer reviews and merges (no self-approve / admin-merge).
  • release.yml — trigger on numeric-semver tags only ([0-9]+.[0-9]+.[0-9]+).
  • main.yml — trigger on branch pushes only, so release tags don't re-run the full matrix.

Validation

release_prep.sh dry run produces a correct self-contained tarball; pre-commit fully green (shellcheck + beautysh included).

Adapt the remaining release-process fixes from mbo's 0.11.1 (the BCR auto-publish
half already landed in #54), so proto can cut a working release.

- release_prep.sh: archive the patched/generated worktree via a throwaway index
  instead of `git archive "${TAG}"`. The latter reads the committed tree and
  silently dropped the edits release_prep makes (the bazelmod.patch hunk that
  comments out the dev-only includes, the generated empty root BUILD.bazel) -- so
  released tarballs shipped with the dev includes active and did not build
  standalone. Verified: the archive's MODULE.bazel now has the includes commented
  and dev dirs are export-ignored.
- Drop .bcr/patches/bazelmod.patch and its `bcr-bazelmod-patch-applies`
  pre-commit hook: the tarball is now self-contained, so publish-to-bcr needs no
  patch (removes the stale-patch failure mode that broke prior publishes; the BCR
  entry's MODULE.bazel is the tarball's directly).
- trigger_release.sh: require running on main at exactly origin/main; validate the
  version arg is numeric X.Y.Z; portable BSD/GNU sed for the version bump and
  CHANGELOG prepend; pre-flight that .github/workflows/bazelmod.patch still
  applies. Keep the simple flow -- open the version-bump PR and stop, leaving
  review+merge to another maintainer (no self-approve/admin-merge).
- release.yml: trigger on numeric-semver tags only ([0-9]+.[0-9]+.[0-9]+).
- main.yml: trigger on branch pushes only, so release tags don't re-run the full
  matrix.
@helly25 helly25 requested a review from Fab-Cat June 20, 2026 17:55
@helly25 helly25 enabled auto-merge (squash) June 20, 2026 17:56
@helly25 helly25 merged commit 9d70206 into main Jun 20, 2026
37 checks passed
@helly25 helly25 deleted the release/self-contained-and-harden branch June 20, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants