Skip to content

Commit da8765f

Browse files
committed
feat: simplify version bump logic in release workflow
1 parent 51edf88 commit da8765f

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ on:
44
workflow_dispatch:
55
inputs:
66
bump:
7-
description: 'Version bump type (use "current" to publish as-is)'
7+
description: 'Version bump type'
88
required: true
99
type: choice
1010
options:
11-
- current
1211
- patch
1312
- minor
1413
- major
@@ -51,20 +50,13 @@ jobs:
5150
id: bump
5251
run: |
5352
OLD_VERSION=$(node -p "require('./package.json').version")
54-
if [ "${{ inputs.bump }}" = "current" ]; then
55-
NEW_VERSION="${OLD_VERSION}"
56-
echo "Publishing current version ${NEW_VERSION}"
57-
else
58-
npm version ${{ inputs.bump }} --no-git-tag-version
59-
NEW_VERSION=$(node -p "require('./package.json').version")
60-
echo "Bumped ${OLD_VERSION} → ${NEW_VERSION} (${{ inputs.bump }})"
61-
fi
53+
npm version ${{ inputs.bump }} --no-git-tag-version
54+
NEW_VERSION=$(node -p "require('./package.json').version")
55+
echo "Bumped ${OLD_VERSION} → ${NEW_VERSION} (${{ inputs.bump }})"
6256
echo "old_version=${OLD_VERSION}" >> $GITHUB_OUTPUT
6357
echo "new_version=${NEW_VERSION}" >> $GITHUB_OUTPUT
64-
echo "is_bump=${{ inputs.bump != 'current' }}" >> $GITHUB_OUTPUT
6558
6659
- name: Update CHANGELOG
67-
if: inputs.bump != 'current'
6860
run: |
6961
NEW_VERSION=${{ steps.bump.outputs.new_version }}
7062
DATE=$(date +%Y-%m-%d)

0 commit comments

Comments
 (0)