Skip to content

Commit d80cc2a

Browse files
committed
🔧 Update GitHub Actions workflow (main.yml):
- Change the event trigger from tag to branch 'main' - Upgrade actions/setup-node to v3 and actions/checkout to v4 - Add npm test step before publishing - Use JS-DevTools/npm-publish action for publishing with NPM_TOKEN secret
1 parent 6aa5a6e commit d80cc2a

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

‎.github/workflows/main.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
name: publish
21
on:
32
push:
4-
tags:
5-
- 'v[0-9]+.[0-9]+.[0-9]+*'
3+
branches: main
4+
65
jobs:
7-
build:
6+
publish:
87
runs-on: ubuntu-latest
98
steps:
10-
- uses: actions/checkout@v2
11-
- uses: actions/setup-node@v1
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-node@v3
1211
with:
13-
node-version: 14
14-
registry-url: 'https://registry.npmjs.org'
12+
node-version: '20'
1513
- run: npm ci
16-
- run: npm publish
17-
env:
18-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
14+
- run: npm test
15+
- uses: JS-DevTools/npm-publish@v3
16+
with:
17+
token: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)