From b0e4e355e8cd42090d3f66fc3f7b0d9ef929493f Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Wed, 3 Dec 2025 21:47:55 +0200 Subject: [PATCH] feat: publish workflow --- .github/workflows/publish.yml | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 762cd3a..712a011 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,3 +1,4 @@ +--- name: Publish on: @@ -7,6 +8,9 @@ on: permissions: read-all +env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + jobs: Linter: name: Lint @@ -16,11 +20,13 @@ jobs: statuses: write contents: read packages: read + issues: write + pull-requests: write steps: - name: Run PR Lint # https://github.com/ivuorinen/actions - uses: ivuorinen/actions/pr-lint@99f3911475dbb5b8d43d314b24c0882997433868 # 25.6.23 + uses: ivuorinen/actions/pr-lint@a52399cf74eac2b0963591ab2c6c8eb0f7f50b2d # v2025.12.01 publish: name: Publish @@ -28,26 +34,31 @@ jobs: needs: - Linter permissions: - contents: write - pull-requests: write - issues: write + contents: write # to be able to publish a GitHub release + issues: write # to be able to comment on released issues + pull-requests: write # to be able to comment on released pull requests + id-token: write # to enable use of OIDC for npm provenance steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: fetch-depth: 0 - name: Setup Node.js Environment - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 with: always-auth: true node-version-file: ".nvmrc" registry-url: "https://registry.npmjs.org" scope: "@ivuorinen" + - name: Install and enable corepack + shell: sh + run: npm install -g corepack --force && corepack enable + - name: Cache Node Modules - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 id: cache with: path: node_modules @@ -58,9 +69,8 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' run: yarn install - - name: Release - shell: bash + - name: Semantic Release + uses: cycjimmy/semantic-release-action@b12c8f6015dc215fe37bc154d4ad456dd3833c90 # v6.0.0 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.PAT }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: yarn run semantic-release