Skip to content

Commit e1c62ec

Browse files
authored
Use npm instead of yarn to publish with provenance (#279)
### Changelog None ### Description Follow-up from #278. It appears `yarn npm publish` does not support `--provenance` (yarnpkg/berry#5430). Per yarnpkg/berry#5430 (comment) this can be worked around by using `yarn pack` with `npm publish`.
1 parent 9f8e45f commit e1c62ec

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ jobs:
3131
- run: yarn run lint:ci
3232
- run: yarn run test
3333

34+
- run: yarn pack
3435
- name: Publish to NPM
3536
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
36-
run: yarn npm publish --provenance --access public
37+
# `yarn npm publish` does not currently support --provenance: https://github.com/yarnpkg/berry/issues/5430
38+
run: npm publish package.tgz --provenance --access public
3739
env:
38-
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
40+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
3941

4042
chromatic:
4143
runs-on: ubuntu-latest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ node_modules/
1111
!.yarn/releases
1212
!.yarn/sdks
1313
!.yarn/versions
14+
package.tgz

0 commit comments

Comments
 (0)