File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 1616 steps :
1717 - uses : actions/checkout@v4
1818
19+ - name : Extract version from tag
20+ id : get_version
21+ run : |
22+ if [ "${{ github.event_name }}" = "release" ]; then
23+ # Extract version from release tag (strips 'v' prefix if present)
24+ VERSION="${{ github.event.release.tag_name }}"
25+ VERSION="${VERSION#v}"
26+ echo "version=$VERSION" >> $GITHUB_OUTPUT
27+ echo "Publishing version: $VERSION"
28+ else
29+ # Manual dispatch - use existing package.json version
30+ VERSION=$(node -p "require('./package.json').version")
31+ echo "version=$VERSION" >> $GITHUB_OUTPUT
32+ echo "Manual dispatch - using package.json version: $VERSION"
33+ fi
34+
35+ - name : Update package.json version
36+ if : github.event_name == 'release'
37+ run : |
38+ npm version ${{ steps.get_version.outputs.version }} --no-git-tag-version
39+ echo "Updated package.json to version ${{ steps.get_version.outputs.version }}"
40+
1941 - name : Setup Node.js
2042 uses : actions/setup-node@v4
2143 with :
You can’t perform that action at this time.
0 commit comments