From 32c77b85d82c7579d7e142f90416220810468a16 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Sat, 6 Dec 2025 13:14:45 +0100 Subject: [PATCH] feat: release pipeline --- .github/workflows/publish.yml | 76 +++++++++++++++++++++++++++++++++++ package.json | 1 - 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..3e7a31f --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,76 @@ +--- +name: Publish + +on: + push: + branches: + - main + +permissions: read-all + +env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + +jobs: + Linter: + name: Lint + runs-on: ubuntu-latest + timeout-minutes: 15 + permissions: + 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@a52399cf74eac2b0963591ab2c6c8eb0f7f50b2d # v2025.12.03 + + publish: + name: Publish + runs-on: ubuntu-latest + needs: + - Linter + permissions: + 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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + fetch-depth: 0 + + - name: Setup Node.js Environment + uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.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@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + id: cache + with: + path: node_modules + key: node-modules-${{ hashFiles('**/yarn.lock') }} + + - name: Install Dependencies + shell: bash + if: steps.cache.outputs.cache-hit != 'true' + run: yarn install + + - name: Semantic Release + uses: cycjimmy/semantic-release-action@b12c8f6015dc215fe37bc154d4ad456dd3833c90 # v6.0.0 + env: + GITHUB_TOKEN: ${{ secrets.PAT }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index df4558d..558f3fb 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,5 @@ "@semantic-release/git": "^10.0.1", "semantic-release": "^25.0.2" }, - "gitHead": "23d15f15743fb59c1dbe658615ef2ed51c54d230", "packageManager": "yarn@4.12.0+sha512.f45ab632439a67f8bc759bf32ead036a1f413287b9042726b7cc4818b7b49e14e9423ba49b18f9e06ea4941c1ad062385b1d8760a8d5091a1a31e5f6219afca8" }