feat: publish workflow

This commit is contained in:
2025-12-03 21:47:55 +02:00
parent b6cc005af4
commit b0e4e355e8

View File

@@ -1,3 +1,4 @@
---
name: Publish name: Publish
on: on:
@@ -7,6 +8,9 @@ on:
permissions: read-all permissions: read-all
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
jobs: jobs:
Linter: Linter:
name: Lint name: Lint
@@ -16,11 +20,13 @@ jobs:
statuses: write statuses: write
contents: read contents: read
packages: read packages: read
issues: write
pull-requests: write
steps: steps:
- name: Run PR Lint - name: Run PR Lint
# https://github.com/ivuorinen/actions # https://github.com/ivuorinen/actions
uses: ivuorinen/actions/pr-lint@99f3911475dbb5b8d43d314b24c0882997433868 # 25.6.23 uses: ivuorinen/actions/pr-lint@a52399cf74eac2b0963591ab2c6c8eb0f7f50b2d # v2025.12.01
publish: publish:
name: Publish name: Publish
@@ -28,26 +34,31 @@ jobs:
needs: needs:
- Linter - Linter
permissions: permissions:
contents: write contents: write # to be able to publish a GitHub release
pull-requests: write issues: write # to be able to comment on released issues
issues: write pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Setup Node.js Environment - name: Setup Node.js Environment
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with: with:
always-auth: true always-auth: true
node-version-file: ".nvmrc" node-version-file: ".nvmrc"
registry-url: "https://registry.npmjs.org" registry-url: "https://registry.npmjs.org"
scope: "@ivuorinen" scope: "@ivuorinen"
- name: Install and enable corepack
shell: sh
run: npm install -g corepack --force && corepack enable
- name: Cache Node Modules - name: Cache Node Modules
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
id: cache id: cache
with: with:
path: node_modules path: node_modules
@@ -58,9 +69,8 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true' if: steps.cache.outputs.cache-hit != 'true'
run: yarn install run: yarn install
- name: Release - name: Semantic Release
shell: bash uses: cycjimmy/semantic-release-action@b12c8f6015dc215fe37bc154d4ad456dd3833c90 # v6.0.0
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn run semantic-release