Skip to content

Commit d4de4e9

Browse files
fix: update version calculation method in release workflow
1 parent 2095c4b commit d4de4e9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ jobs:
2929
- name: Calculate next version
3030
id: next_version
3131
run: |
32-
# Use npm version to calculate the next version without modifying files
32+
# Use npm version to calculate the next version without modifying files
3333
CURRENT_VERSION=$(node -p "require('./package.json').version")
34-
NEW_VERSION=$(npm version ${{ github.event.inputs.version }} --no-git-tag-version)
34+
NEW_VERSION=$(npx semver $CURRENT_VERSION -i ${{ github.event.inputs.version }})
3535
3636
# Restore package.json to avoid dirty state
3737
git checkout package.json package-lock.json 2>/dev/null || true
@@ -82,7 +82,6 @@ jobs:
8282
- name: Bump version and update CHANGELOG
8383
id: bump
8484
run: |
85-
NEW_VERSION=$(npm version ${{ github.event.inputs.version }} --no-git-tag-version)
8685
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
8786
sed -i "s/## \[Unreleased\]/## [Unreleased]\n\n## [$NEW_VERSION] - $(date +%Y-%m-%d)/" CHANGELOG.md
8887
@@ -106,6 +105,7 @@ jobs:
106105
name: ${{ steps.bump.outputs.version }}
107106
body: ${{ steps.changelog.outputs.notes }}
108107
files: ${{ steps.pack.outputs.tgz }}
108+
target_commitish: ${{ github.sha }}
109109
fail_on_unmatched_files: true
110110
draft: false
111111
prerelease: false

0 commit comments

Comments
 (0)