Skip to content

Commit 9886c74

Browse files
committed
fix: Prevent duplicate tag creation in release process
Use --no-git-tag-version to prevent npm from creating a tag, then create a single annotated tag with changelog content via create-tag script in postversion. This avoids the redundant tag check and gives full control over commit and tag messages.
1 parent 442800d commit 9886c74

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
"prepare": "npm run build",
4545
"preversion": "npm run test:local",
4646
"version": "node scripts/update-version.js && npm run update-changelog && npm run format && git add -A",
47-
"postversion": "npm run create-tag && git push && git push --tags",
48-
"release": "npm version patch",
49-
"release:minor": "npm version minor",
50-
"release:major": "npm version major"
47+
"postversion": "git commit -m \"Release v$npm_package_version\" && npm run create-tag && git push && git push --tags",
48+
"release": "npm version patch --no-git-tag-version",
49+
"release:minor": "npm version minor --no-git-tag-version",
50+
"release:major": "npm version major --no-git-tag-version"
5151
},
5252
"files": [
5353
"src/",

0 commit comments

Comments
 (0)