chore: CI: publish to npm using OIDC tokens (#36)
Some checks are pending
test / lint-and-spellcheck (push) Waiting to run
test / unit-tests (18.x) (push) Waiting to run
test / unit-tests (20.x) (push) Waiting to run
test / unit-tests (22.x) (push) Waiting to run
test / integration-tests (18.x) (push) Waiting to run
test / integration-tests (20.x) (push) Waiting to run
test / integration-tests (22.x) (push) Waiting to run
test / e2e-tests (18.x) (push) Blocked by required conditions

see also https://docs.npmjs.com/trusted-publishers
This commit is contained in:
Jannis 2025-10-22 20:44:53 +02:00 committed by GitHub
parent c2216120c9
commit d0120439e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,6 +10,9 @@ env:
REGISTRY: ghcr.io REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }} IMAGE_NAME: ${{ github.repository }}
permissions:
id-token: write # for OIDC-based publishing to npm
jobs: jobs:
build-and-push-docker: build-and-push-docker:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -53,7 +56,9 @@ jobs:
with: with:
node-version: '20.x' node-version: '20.x'
registry-url: 'https://registry.npmjs.org' registry-url: 'https://registry.npmjs.org'
# for OIDC-based publishing to npm
- name: setup npm v11
run: npm install -g npm@11
- run: npm ci - run: npm ci
- run: npm publish --provenance --access public - run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}