Skip to content

Commit 55a5ade

Browse files
committed
PR feedback
1 parent 01564d0 commit 55a5ade

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

.github/workflows/ci.yml

+8-7
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ on:
77
push:
88
branches:
99
- master
10-
tags:
11-
- 'v*.*.*'
10+
release:
11+
types: [published]
1212

1313
jobs:
1414
test:
@@ -96,11 +96,14 @@ jobs:
9696
9797
publish:
9898
runs-on: ubuntu-latest
99-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
99+
if: github.event_name == 'release'
100100
needs:
101101
- test
102102
- build
103103
- lint
104+
env:
105+
# Used in setup-node and publish steps
106+
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }}
104107
steps:
105108
- name: Checkout
106109
uses: actions/checkout@v4
@@ -110,14 +113,12 @@ jobs:
110113
with:
111114
node-version-file: .nvmrc
112115
cache: 'yarn'
116+
registry-url: 'https://registry.npmjs.org'
113117

114118
- name: Install dependencies
115119
run: yarn install --frozen-lockfile
116120

117121
- run: yarn build
118122

119-
- name: Authenticate with npm registry
120-
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPMJS_PUBLISH_TOKEN }}" > ~/.npmrc
121-
122123
- name: Publish to npm registry
123-
run: npm publish --access=public
124+
run: npm publish --provenance --access public

0 commit comments

Comments
 (0)