From 967558a36782514dc6a07643bd7758c64422f2fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ju=CC=88rg=20Lehni?= Date: Thu, 15 Oct 2026 22:24:23 +0200 Subject: [PATCH] Publish version tags to npm through trusted publishing --- .github/workflows/publish.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 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 000000000..0e28a2c78 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,28 @@ +name: publish + +# Publishes the version of a pushed version tag to npm through npm's trusted +# publishing: npm trusts this workflow, so no tokens are needed. The dist-tag +# comes from `publishConfig.tag` of the tagged commit: `next` on next, `latest` +# on main. +on: + push: + tags: ['v*'] + +permissions: + contents: read + id-token: write + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v7 + + # Trusted publishing needs npm 11.5.1 or later, which comes with Node 24. + - uses: actions/setup-node@v7 + with: + node-version: 24.x + registry-url: https://registry.npmjs.org + + - run: npm publish