Skip to content

Commit 3d60633

Browse files
committed
feat: add automated tagging and release creation in GitHub Actions workflow
1 parent 2ce5aee commit 3d60633

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/deploy-npm.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ jobs:
3232

3333
# Update the version in package.json
3434
- name: Update version
35+
id: update_version
3536
run: |
3637
VERSION="0.0.1-alpha.$HASH"
3738
jq --arg ver "$VERSION" '.version = $ver' package.json > tmp.json && mv tmp.json package.json
39+
echo "VERSION=$VERSION" >> $GITHUB_ENV
3840
3941
# Build the package
4042
- name: Build package
@@ -49,3 +51,22 @@ jobs:
4951
env:
5052
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5153
run: npm publish
54+
55+
# Create Git tag
56+
- name: Create Git tag
57+
run: |
58+
git config --local user.name "github-actions[bot]"
59+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
60+
git tag ${{ env.VERSION }}
61+
git push origin ${{ env.VERSION }}
62+
63+
# Create GitHub Release
64+
- name: Create GitHub Release
65+
uses: actions/create-release@v1
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
with:
69+
tag_name: ${{ env.VERSION }}
70+
release_name: Release ${{ env.VERSION }}
71+
draft: false
72+
prerelease: true

0 commit comments

Comments
 (0)