Skip to content

Commit 8955c64

Browse files
committed
chore: enhance GitHub Actions workflow to extract version from tags and create draft releases
1 parent 1bd0b7e commit 8955c64

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

.github/workflows/publish.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
1315

1416
- name: Set up Node.js
1517
uses: actions/setup-node@v4
@@ -31,4 +33,19 @@ jobs:
3133
working-directory: nodejs
3234
run: npm publish --access public
3335
env:
34-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
36+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
37+
38+
- name: Extract version from tag
39+
run: |
40+
# Extract version from tag (remove 'v' prefix)
41+
VERSION=${GITHUB_REF#refs/tags/v}
42+
echo "VERSION=$VERSION" >> $GITHUB_ENV
43+
echo "Extracted version: $VERSION"
44+
45+
- name: Create draft release
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
run: |
49+
gh release create "$GITHUB_REF_NAME" \
50+
--title "Release v${{ env.VERSION }}" \
51+
--draft

0 commit comments

Comments
 (0)