-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (38 loc) · 1.08 KB
/
publish-npm.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Publish NPM Package
on:
push:
branches:
- main
permissions:
id-token: write
pages: write
jobs:
commit:
runs-on: ubuntu-latest
if: ${{ !startsWith(github.event.head_commit.message, 'Release') }}
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
# setup git user
- run: git config user.name "$GITHUB_ACTOR"
- run: git config user.email "[email protected]"
# incremnet package version and create a commit
- run: npm version prerelease --preid=next -m "Release %s"
- run: git push
publish-npm:
runs-on: ubuntu-latest
# if: ${{ startsWith(github.event.head_commit.message, 'Release') }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm install --force
- run: npm publish --tag next
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}