Skip to content

ci: fix provenance generation in GitHub Actions requires "write" acce… #28

ci: fix provenance generation in GitHub Actions requires "write" acce…

ci: fix provenance generation in GitHub Actions requires "write" acce… #28

Workflow file for this run

# see https://docs.github.com/zh/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry
name: Publish Package to npmjs
on:
push:
tags: ['*']
permissions:
id-token: write
jobs:
publish:
name: 'Publish'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Publish
working-directory: ./lib
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true