Skip to content

ci: block releases on tag/manifest mismatch - #183

Merged
EVWorth merged 2 commits into
mainfrom
ci/release-tag-check
Jul 19, 2026
Merged

EVWorth merged 2 commits into
mainfrom
ci/release-tag-check

Conversation

@EVWorth

@EVWorth EVWorth commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a CI guardrail preventing the release workflow from building when the pushed tag's version doesn't match the manifest versions.

Why

v0.3.4 tag was created on main while the manifests still said 0.3.3. Fixed in #182 by bumping manifests. This PR makes that class of bug impossible going forward.

Changes

.github/workflows/release.yml

  • New validate job runs first on any v* tag push
  • Reads tag from GITHUB_REF_NAME, compares against package.json, Cargo.toml, tauri.conf.json
  • Fails the workflow if any mismatch, with actionable error messages pointing at make bump
  • build job now needs: validate (won't run if validate fails)

scripts/check-release-readiness.sh (new)

Local pre-flight check, runnable manually before tagging:

scripts/check-release-readiness.sh           # manifests agree?
scripts/check-release-readiness.sh 0.3.5     # also check vs version
scripts/check-release-readiness.sh --strict  # also tree clean + on main

What it catches

Scenario Caught by
package.json ≠ Cargo.toml ≠ tauri.conf.json Both (local + CI)
Tag pushed without bumping manifests CI validate job
Manifests bumped but tag never created Local script (with --strict)
Working tree dirty when tagging Local script (with --strict)
Not on main when tagging Local script (with --strict)

Test plan

After merge:

  1. Manually push a bad tag (e.g., bump manifests to 0.3.5 but push v0.3.4 tag) → CI should fail with clear error
  2. Run scripts/check-release-readiness.sh 0.3.5 locally with manifests at 0.3.4 → script fails
  3. Run scripts/check-release-readiness.sh --strict on dirty tree → script fails

Related

  • chore: align manifests with v0.3.4 tag #182 — fixes the v0.3.4 manifest/tag mismatch this guardrail prevents recurring
  • .opencode/agent/release-cutter.md — should be updated to recommend this script (can do as follow-up)
  • .opencode/AGENTS.md — release flow section can reference this (follow-up)

EVWorth added 2 commits July 18, 2026 20:39
Adds guardrail preventing the release workflow from building when the
pushed tag's version doesn't match the manifest versions.

Also adds scripts/check-release-readiness.sh — local pre-flight check
that validates manifests agree (and optionally match an expected tag,
tree clean, on main).

What it catches:
  - Manifests disagree (package.json ≠ Cargo.toml ≠ tauri.conf.json)
  - Tag pushed without bumping manifests first
  - Manifests bumped but tag never created

Background: v0.3.4 tag was created on main while manifests still said
0.3.3. Fixed in #182 by bumping manifests. This guardrail makes that
class of bug impossible going forward — release.yml's new `validate`
job fails the build before any artifact is produced.

Workflow change:
  - New `validate` job runs first
  - Reads tag from GITHUB_REF_NAME
  - Compares against all 3 manifests
  - Fails if any mismatch, with actionable error messages
  - `build` job now `needs: validate`

Local script (scripts/check-release-readiness.sh):
  - Default: verifies manifests agree
  - --strict: also requires clean tree + on main
  - With version arg: also checks manifests match that version
- Refactor validate job to invoke scripts/check-release-readiness.sh
  (kills inline bash dup, removes Node dependency from CI)
- Pin actions/checkout to SHA matching build job (supply-chain consistency)
- Add permissions: contents: read to validate job (least-privilege)
- Improve manifest-disagreement error message (make bump increments,
  doesn't reconcile drift — direct user to manual alignment)
- Add trailing newline to scripts/check-release-readiness.sh
@EVWorth
EVWorth force-pushed the ci/release-tag-check branch from 165477a to bb9e733 Compare July 19, 2026 01:43
@EVWorth
EVWorth merged commit a1cb7c2 into main Jul 19, 2026
8 of 9 checks passed
@EVWorth
EVWorth deleted the ci/release-tag-check branch July 19, 2026 02:49
EVWorth added a commit that referenced this pull request Jul 19, 2026
Closes the loop from #183 (release guardrail):

- AGENTS.md Release Flow section now references
  scripts/check-release-readiness.sh at step 0 (pre-flight) and
  step 3 (post-bump, pre-tag). Documents the CI validate job as
  second line of defense.

- release-cutter.md pre-conditions delegate to the script instead
  of re-implementing the checks. Single source of truth for
  release-readiness logic.

Both changes are documentation-only. No code paths changed.

Refs: #183
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.

1 participant