From 0f8979a38a72157cc3ac724b6731abca62b03c4e Mon Sep 17 00:00:00 2001 From: Erik Rasmussen Date: Tue, 5 May 2026 08:57:45 +0200 Subject: [PATCH] ci: add npm publish workflow on GitHub release --- .github/workflows/publish.yml | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..27b82693 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,37 @@ +name: Publish + +on: + release: + types: [published] + +permissions: + contents: read + id-token: write + +jobs: + publish: + name: Publish to npm + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: Use Node.js 22 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 + with: + node-version: "22" + registry-url: "https://registry.npmjs.org" + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Run tests + run: yarn start test + + - name: Build + run: yarn start build + + - name: Publish + run: npm publish --provenance ${{ github.event.release.prerelease && '--tag next' || '' }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}