Skip to content

feat: automate manifest version stamping for extension uploads#28

Merged
ryanbas21 merged 4 commits into
mainfrom
feat/manifest-version-automation
May 12, 2026
Merged

feat: automate manifest version stamping for extension uploads#28
ryanbas21 merged 4 commits into
mainfrom
feat/manifest-version-automation

Conversation

@ryanbas21
Copy link
Copy Markdown
Owner

Summary

  • Add stampVersion pure function that appends a CI build number as the 4th segment of the Chrome extension manifest version (MAJOR.MINOR.PATCH.BUILD)
  • Integrate into build.mjs so dist/manifest.json gets stamped at build time via BUILD_NUMBER env var
  • Update all CI workflows (release.yml, publish-extension.yml) to pass github.run_number as BUILD_NUMBER
  • Snapshot builds also set SNAPSHOT=true for human-readable version_name labeling

How it works

Scenario manifest version version_name
Local dev 0.1.0.0 not set
Snapshot (CI) 0.1.0.<run_number> 0.1.0-snapshot.<run_number>
Release (CI) 0.X.Y.<run_number> 0.X.Y

The source manifest.json is never modified — only dist/manifest.json gets the stamped version. To bump the base version, manually edit manifest.json.

Test plan

  • Unit tests: 9 test cases for stampVersion (local dev, snapshot, release, boundary, NaN, negative)
  • Integration: verified local build produces 0.1.0.0
  • Integration: verified BUILD_NUMBER=42 SNAPSHOT=true produces 0.1.0.42 + version_name
  • Integration: verified Firefox build also gets stamped version
  • All 24 existing tests still pass

🤖 Generated with Claude Code

ryanbas21 and others added 4 commits May 12, 2026 09:25
Extracts manifest version stamping into a pure, testable function.
Appends a CI build number as the 4th version segment so every
Chrome Web Store upload has a unique, always-increasing version.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
build.mjs now appends BUILD_NUMBER env var as the 4th version segment
to dist/manifest.json. Sets version_name for human-readable display.
Local builds default to X.Y.Z.0.

Uses --experimental-strip-types to import stamp-version.ts directly
into the Node ESM build script without a separate compile step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Every workflow that builds and uploads the extension now passes
github.run_number as BUILD_NUMBER. Snapshot builds also set
SNAPSHOT=true for version_name labeling.

Direct node build.mjs calls updated with --experimental-strip-types
to support the .ts import in build.mjs.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ryanbas21 ryanbas21 merged commit 88c0a18 into main May 12, 2026
1 check passed
@ryanbas21 ryanbas21 deleted the feat/manifest-version-automation branch May 12, 2026 15:54
@github-actions github-actions Bot mentioned this pull request May 12, 2026
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