Skip to content

Commit f7f217b

Browse files
committed
chore: sync package.json version to release tag
1 parent 0c8845b commit f7f217b

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,22 +88,11 @@ jobs:
8888
core.info(`Computed next version: ${nextVersion}`);
8989
core.setOutput('version', nextVersion);
9090
91-
- name: Update package.json version
92-
env:
93-
VERSION: ${{ steps.version.outputs.version }}
94-
run: |
95-
node -e "const fs=require('fs'); const pkg=JSON.parse(fs.readFileSync('package.json','utf8')); pkg.version=process.env.VERSION; pkg._versionComment='Version is auto-generated by the CI auto-release workflow. Manual edits are overwritten.'; fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2)+ '\n');"
96-
git config user.name "github-actions"
97-
git config user.email "[email protected]"
98-
git add package.json
99-
git commit -m "chore: release ${VERSION} [skip ci]" || echo "No changes to commit"
100-
10191
- name: Create and push tag
10292
env:
10393
VERSION: ${{ steps.version.outputs.version }}
10494
run: |
10595
if git rev-parse ${VERSION} >/dev/null 2>&1; then echo "Tag ${VERSION} already exists"; else git tag ${VERSION}; git push origin ${VERSION}; fi
106-
git push origin HEAD:main
10796
10897
- name: Generate release notes & create release
10998
uses: ./.github/actions/anthropic-release-notes
@@ -173,6 +162,12 @@ jobs:
173162
- name: Install vsce
174163
run: npm install -g @vscode/vsce
175164

165+
- name: Sync package.json version to tag (no commit)
166+
env:
167+
TAG_VERSION: ${{ github.event.release.tag_name }}
168+
run: |
169+
node -e "const fs=require('fs'); const tag=process.env.TAG_VERSION.replace(/^v/,''); const pkg=JSON.parse(fs.readFileSync('package.json','utf8')); if(pkg.version!==tag){ pkg.version=tag; fs.writeFileSync('package.json', JSON.stringify(pkg,null,2)+'\n'); console.log('Synced package.json version to tag', tag); } else { console.log('package.json version already matches tag', tag); }"
170+
176171
- name: Publish to VS Code Marketplace
177172
env:
178173
VSCE_PAT: ${{ secrets.VSCE_PAT }}

0 commit comments

Comments
 (0)