Skip to content

Commit 7ce7504

Browse files
committed
feat: add automated tagging and release creation in GitHub Actions workflow
1 parent 8f2f9d3 commit 7ce7504

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

.github/workflows/deploy-npm.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches:
66
- master
77

8+
permissions:
9+
contents: write
10+
811
jobs:
912
publish-npm:
1013
runs-on: ubuntu-latest
@@ -13,6 +16,8 @@ jobs:
1316
# Checkout the repository
1417
- name: Checkout repository
1518
uses: actions/checkout@v3
19+
with:
20+
token: ${{ secrets.HUB_TOKEN }}
1621

1722
# Set up Node.js environment
1823
- name: Set up Node.js
@@ -46,12 +51,6 @@ jobs:
4651
- name: Run tests
4752
run: npm test
4853

49-
# Publish to npm
50-
- name: Publish to npm
51-
env:
52-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
53-
run: npm publish
54-
5554
# Create Git tag
5655
- name: Create Git tag
5756
run: |
@@ -64,9 +63,15 @@ jobs:
6463
- name: Create GitHub Release
6564
uses: actions/create-release@v1
6665
env:
67-
HUB_TOKEN: ${{ secrets.HUB_TOKEN }}
66+
GITHUB_TOKEN: ${{ secrets.HUB_TOKEN }}
6867
with:
6968
tag_name: ${{ env.VERSION }}
7069
release_name: Release ${{ env.VERSION }}
7170
draft: false
72-
prerelease: true
71+
prerelease: true
72+
73+
# Publish to npm
74+
- name: Publish to npm
75+
env:
76+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
77+
run: npm publish

0 commit comments

Comments
 (0)