From 1ee5a5c07f305646d3ff4b53b8a019628a011190 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Fri, 12 May 2023 18:53:24 +0000 Subject: [PATCH] CI: auto-publish to NPM on GH release --- .github/workflows/publish-npm.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/publish-npm.yml diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml new file mode 100644 index 0000000..3438a7f --- /dev/null +++ b/.github/workflows/publish-npm.yml @@ -0,0 +1,23 @@ +name: Publish Package to npm +on: + release: + types: [created] +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3 + - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 + with: + node-version: 20 + registry-url: 'https://registry.npmjs.org' + cache: npm + - run: npm install -g npm + - run: npm ci + - run: npm run build + - run: npm publish --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}