Skip to content

Commit

Permalink
CI: publish to npm with provenance (#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmercm authored Aug 25, 2023
1 parent 2825d6b commit be4a6da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
"node:$(cat .nvmrc)" sh -c \
"./node_modules/.bin/caxa --input build/ --output igir -- \"{{caxa}}/node_modules/.bin/node\" \"{{caxa}}/index.js\" && ./igir --help"
tar cvf - igir | gzip --best > "${BIN_OUTPUT}"
# TODO(cemmer): macOS arm64: https://github.com/github/roadmap/issues/528
- os: macos
build: |
NPM_PKG_VERSION=$(npm pkg get version | sed 's/"//g')
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
jobs:
node-publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -23,6 +26,6 @@ jobs:
run: |
echo 'registry="https://registry.npmjs.org/"' > ./.npmrc
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" >> ./.npmrc
npm publish --regsitry=https://registry.npmjs.org/ --userconfig=./.npmrc
npm publish --regsitry=https://registry.npmjs.org/ --userconfig=./.npmrc --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit be4a6da

Please sign in to comment.