Skip to content

ci(publish): tag-driven publish with semver validation and auto-releases - #42

Merged
gcko merged 4 commits into
mainfrom
ci/tag-driven-publish
Aug 3, 2026
Merged

ci(publish): tag-driven publish with semver validation and auto-releases#42
gcko merged 4 commits into
mainfrom
ci/tag-driven-publish

Conversation

@gcko

@gcko gcko commented Aug 3, 2026

Copy link
Copy Markdown
Owner

PR checklist

  • Ensure you have added or ran the appropriate tests for your PR.
  • DCO signed

What type of PR is this?

ci

What this PR does / why we need it:

Publishing is kicked off by pushing a git tag, and this PR makes the tag the actual source of truth instead of just a trigger. Today the workflow builds whatever the tag points at and fails if versions mismatch; nothing stops a non-semver tag, a tag lower than what's already shipped, or a tag on a side branch, and GitHub releases have to be written by hand (which is why 3.0.0 through 4.0.0 had none until this week).

The reworked publish-extension.yml runs four jobs:

  • validate — the tag must be strict vMAJOR.MINOR.PATCH, must sort above every existing release tag (you can only tag up, never backwards), and must point at a commit on main. A bad tag fails here and nothing publishes.
  • publish — syncs package.json and public/manifest.json to the tag version in the build workspace (new scripts/set-version.cjs, also exposed as pnpm set-version), runs the test suite, builds, checks the version actually baked into app.zip against the tag, then uploads to the Chrome Web Store exactly as before.
  • release — extracts the tag's section from CHANGELOG.md and creates the GitHub release, so releases can't lag tags again. Falls back to a changelog link if the section is missing (validate warns about that early).
  • sync-versions — only runs when the repo files lagged the tag: opens a PR bringing package.json and manifest.json up to the published version, keeping the no-direct-commits-to-main rule intact.

docs/development.md, CLAUDE.md, and AGENTS.md are updated to describe the new flow.

Which issue(s) this PR fixes:

n/a

Special notes for your reviewer:

set-version.cjs rewrites only the version value with a targeted replacement rather than JSON.stringify, so file formatting (like the inline permissions array) survives byte-for-byte; verified by a set/unset round trip leaving no diff. The awk changelog extraction and the sort -V ordering were tested locally against the real CHANGELOG. One known caveat, noted in the sync PR body: PRs opened with the Actions token don't trigger CI, so a drift-sync PR needs an empty commit or a close/reopen to get checks.

The store upload step and its four secrets are untouched.

Does this PR introduce a user-facing change?:

NONE

gcko and others added 2 commits August 3, 2026 14:06
The publish workflow now treats the pushed tag as the source of truth
for the release version. A validate job rejects tags that are not
strict vMAJOR.MINOR.PATCH semver, do not sort above every existing
release tag, or point at commits not on main. The publish job syncs
package.json and public/manifest.json to the tag version in the build
workspace before building (scripts/set-version.cjs, also exposed as
pnpm set-version), runs the test suite, and verifies the version baked
into app.zip before uploading to the Chrome Web Store. A release job
mirrors the tag's CHANGELOG.md section into a GitHub release so
releases stop lagging tags, and a sync-versions job opens a PR when
the repo files lagged the tag.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Jared Scott <jared.scott@variable.team>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Jared Scott <jared.scott@variable.team>
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Coverage Report

Summary

Metric Coverage Change
Overall 97.2% +0.0% +

gcko added 2 commits August 3, 2026 14:17
Signed-off-by: Jared Scott <jared.scott@variable.team>

# Conflicts:
#	docs/KNOWLEDGE_BASE.md
@gcko
gcko merged commit 7b8d549 into main Aug 3, 2026
6 checks passed
@gcko
gcko deleted the ci/tag-driven-publish branch August 3, 2026 06:23
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