Skip to content

Commit 39e5d89

Browse files
Modify workflow to publish npm package (#42)
* Modify workflow to publish npm package * Uppercase for token
1 parent 8fbf1ba commit 39e5d89

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,27 @@ name: Node.js CI
55

66
on:
77
push:
8-
branches: [ master ]
9-
tags: [v*]
8+
branches:
9+
- master
10+
- release-*
11+
tags:
12+
- v*
1013
pull_request:
11-
branches: [ master ]
14+
branches:
15+
- master
16+
- release-*
1217

1318
jobs:
1419
build:
1520
runs-on: ubuntu-latest
16-
21+
env:
22+
NODE_VER: 10
1723
steps:
1824
- uses: actions/checkout@v2
1925
- name: Use Node.js
2026
uses: actions/setup-node@v1
2127
with:
22-
node-version: 10
28+
node-version: ${{ env.NODE_VER }}
2329

2430
- run: npm ci
2531
env:
@@ -31,16 +37,16 @@ jobs:
3137

3238
- name: Is Release?
3339
if: startswith(github.ref, 'refs/tags/v')
34-
run: echo "##[set-env name=DEPLOY_PACKAGE;]true"
40+
run: echo "::set-env name=DEPLOY_PACKAGE::true"
3541

3642
- name: Publish to npm
3743
if: env.DEPLOY_PACKAGE == 'true'
38-
run: npm set registry https://registry.npmjs.org/ && npm publish
44+
run: npm set registry https://registry.npmjs.org/ && npm publish --access public
3945
env:
40-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
46+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
4147

4248
- name: Publish to github
4349
if: env.DEPLOY_PACKAGE == 'true'
4450
run: npm set registry https://npm.pkg.github.com/ && npm publish
4551
env:
46-
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
52+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)