Skip to content

Commit cd52630

Browse files
committed
Sync publish version with git tag
1 parent 3a728ad commit cd52630

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/tagged_release.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ jobs:
117117
- name: Install dependencies (skip scripts)
118118
run: npm ci --ignore-scripts
119119

120+
- name: Align package version with tag
121+
env:
122+
TAG_VERSION: ${{ github.ref_name }}
123+
run: |
124+
node -e "const fs=require('fs'); const tag=process.env.TAG_VERSION || ''; const version=tag.startsWith('v') ? tag.slice(1) : tag; if(!version){throw new Error('Missing tag version');} const pkgPath='package.json'; const pkg=JSON.parse(fs.readFileSync(pkgPath,'utf8')); if(pkg.version!==version){pkg.version=version; fs.writeFileSync(pkgPath, JSON.stringify(pkg,null,2)+'\\n'); console.log('Updated package version to', version);} else {console.log('Package version already', version);}"
125+
120126
- name: Show package contents
121127
run: npm pack --dry-run
122128

RUNNER-FIX-HISTORY.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,17 @@ This file records the CI/workflow fix iterations so another agent can continue f
464464
- `target: linux-x64`
465465
- `node_arch: x64`
466466
- `build_for_arch: x64`
467+
468+
### Iteration AO (in progress)
469+
- GitHub run checked: `22662557655` (`Build & Publish tagged release`) for tag `v0.4.8`.
470+
- Outcome:
471+
- all platform build jobs succeeded (`darwin-arm64`, `darwin-x64`, `win32-x64`, `linux-x64`).
472+
- publish failed at npm with: `You cannot publish over the previously published versions: 0.3.15`.
473+
- Root cause:
474+
- package version in `package.json` remained `0.3.15` and was not synchronized with release tags.
475+
- Current local fix:
476+
- `.github/workflows/tagged_release.yaml`
477+
- add step in publish job to align `package.json` version from `github.ref_name` (strip leading `v`) before `npm pack`/`npm publish`.
467478
## Current Hypothesis
468479
Primary remaining blocker has shifted from crash/fatal errors to CLI capability variance on the Windows runner (notably `tsv` config availability).
469480

0 commit comments

Comments
 (0)