Skip to content

Commit a65b8d1

Browse files
Use git tag name for release package version
- Build script now uses tag name (e.g., 1.0.0-rc1) instead of base version from manifest.json - CI passes VERSION_TAG env var to build (git describe doesn't work in shallow checkout) - Local builds still detect tags via git describe 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 7f9129f commit a65b8d1

3 files changed

Lines changed: 21 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232

3333
- name: Build extensions
3434
run: npm run build
35+
env:
36+
VERSION_TAG: ${{ github.ref_name }}
3537

3638
- name: Create GitHub Release
3739
env:

CLAUDE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,3 +411,12 @@ Error: Could not connect to Chrome. Check if Chrome is running and remote debugg
411411
```
412412

413413
Start Chrome manually with: `./chrome-canary.sh --start`
414+
415+
# Release
416+
417+
## Tags
418+
419+
Releases use annotated, not lightweight, tags. The annotated tag message is simply the tag name
420+
itself: `v1.0.0`, because the release notes explain the release content.
421+
422+
Prerelease tags use `-rcX` notation, e.g., `v1.0.0-rc3`.

scripts/copy.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,21 @@ if (!browser || !['chrome', 'firefox'].includes(browser)) {
1818
const TARGET = path.join(ROOT, 'build', browser);
1919

2020
function getVersionName(baseVersion) {
21+
// Check for VERSION_TAG env var (set by CI for release builds)
22+
const versionTag = process.env.VERSION_TAG;
23+
if (versionTag) {
24+
return versionTag.startsWith('v') ? versionTag.slice(1) : versionTag;
25+
}
26+
2127
try {
2228
// Get short commit hash
2329
const commitHash = execSync('git rev-parse --short HEAD', { cwd: ROOT, encoding: 'utf8' }).trim();
2430

25-
// Check if HEAD is tagged (production release)
31+
// Check if HEAD is tagged (release build)
2632
try {
27-
execSync('git describe --exact-match HEAD', { cwd: ROOT, encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] });
28-
// HEAD is tagged - production build, use base version
29-
return baseVersion;
33+
const tag = execSync('git describe --exact-match HEAD', { cwd: ROOT, encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] }).trim();
34+
// HEAD is tagged - use tag name as version (strip 'v' prefix if present)
35+
return tag.startsWith('v') ? tag.slice(1) : tag;
3036
} catch {
3137
// Not tagged - development build
3238
}

0 commit comments

Comments
 (0)