From 8ae003ec0f960116c6458bbb0bd4337cdc37b8c1 Mon Sep 17 00:00:00 2001 From: "Kody (bot)" <72270156+kody-bot@users.noreply.github.com> Date: Tue, 12 May 2026 12:39:26 -0600 Subject: [PATCH 1/6] ci: harden npm release workflow --- .github/workflows/release.yml | 75 ++++++++++++++++++++++++++--------- 1 file changed, 56 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 39e0498..bf0081c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,59 +6,95 @@ concurrency: cancel-in-progress: true permissions: - contents: write # to be able to publish a GitHub release - id-token: write # to enable use of OIDC for npm provenance - issues: write # to be able to comment on released issues - pull-requests: write # to be able to comment on released pull requests + contents: read jobs: test: - name: 🧪 Test + name: 🧪 Test runs-on: ubuntu-latest steps: - - name: ⬇️ Checkout repo + - name: ⬇️ Checkout repo uses: actions/checkout@v5 - - name: ⎔ Setup node + - name: ⎔ Setup node uses: actions/setup-node@v6 with: node-version: 20 - - name: 📥 Download deps + - name: 📥 Download deps uses: bahmutov/npm-install@v1 with: useLockFile: false - - name: 🧪 Test + - name: 🧪 Test run: npm run test - release: - name: 🚀 Release + build-release-artifact: + name: 📦 Build release artifact needs: [test] runs-on: ubuntu-latest + permissions: + contents: read if: ${{ github.repository == 'epicweb-dev/client-hints' && contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha', github.ref) && github.event_name == 'push' }} steps: - name: ⬇️ Checkout repo - uses: actions/checkout@v5 + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 - name: ⎔ Setup node - uses: actions/setup-node@v6 + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: node-version: lts/* + package-manager-cache: false - - name: 📥 Download deps - uses: bahmutov/npm-install@v1 - with: - useLockFile: false + - name: 📥 Install deps + run: npm install --ignore-scripts - - name: 📦 Run Build + - name: 📦 Prepare package run: npm run build + - name: 📦 Upload package artifact + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + with: + name: npm-package-artifact + path: dist + if-no-files-found: error + retention-days: 1 + + release: + name: 🚀 Release + needs: [build-release-artifact] + runs-on: ubuntu-latest + permissions: + contents: write # to be able to publish a GitHub release + id-token: write # to enable use of OIDC for npm provenance + issues: write # to be able to comment on released issues + pull-requests: write # to be able to comment on released pull requests + if: + ${{ github.repository == 'epicweb-dev/client-hints' && + contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha', + github.ref) && github.event_name == 'push' }} + steps: + - name: ⬇️ Checkout repo + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 + + - name: ⎔ Setup node + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 + with: + node-version: 24 + registry-url: https://registry.npmjs.org + package-manager-cache: false + + - name: 📦 Download package artifact + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 + with: + name: npm-package-artifact + path: dist + - name: 🚀 Release - uses: cycjimmy/semantic-release-action@v5.0.2 + uses: cycjimmy/semantic-release-action@ba330626c4750c19d8299de843f05c7aa5574f62 # v5.0.2 with: semantic_version: 25 branches: | @@ -73,3 +109,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_CONFIG_PROVENANCE: true + NPM_CONFIG_IGNORE_SCRIPTS: true From f84f9996b4c6887b516faf8b3960d2e72cc684a8 Mon Sep 17 00:00:00 2001 From: "Kody (bot)" <72270156+kody-bot@users.noreply.github.com> Date: Tue, 12 May 2026 12:47:38 -0600 Subject: [PATCH 2/6] ci: fix workflow utf-8 encoding --- .github/workflows/release.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bf0081c..ba1fbd1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,23 +10,23 @@ permissions: jobs: test: - name: 🧪 Test + name: 🧪 Test runs-on: ubuntu-latest steps: - - name: ⬇️ Checkout repo + - name: ⬇️ Checkout repo uses: actions/checkout@v5 - - name: ⎔ Setup node + - name: ⎔ Setup node uses: actions/setup-node@v6 with: node-version: 20 - - name: 📥 Download deps + - name: 📥 Download deps uses: bahmutov/npm-install@v1 with: useLockFile: false - - name: 🧪 Test + - name: 🧪 Test run: npm run test build-release-artifact: @@ -43,7 +43,7 @@ jobs: - name: ⬇️ Checkout repo uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 - - name: ⎔ Setup node + - name: ⎄ Setup node uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: node-version: lts/* @@ -80,7 +80,7 @@ jobs: - name: ⬇️ Checkout repo uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 - - name: ⎔ Setup node + - name: ⎄ Setup node uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: node-version: 24 From 8e2285f4194a65018861fb6f2f32433550d6debe Mon Sep 17 00:00:00 2001 From: "Kody (bot)" <72270156+kody-bot@users.noreply.github.com> Date: Tue, 12 May 2026 12:50:59 -0600 Subject: [PATCH 3/6] ci: address workflow review feedback --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ba1fbd1..eb7f3e8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,7 +61,7 @@ jobs: name: npm-package-artifact path: dist if-no-files-found: error - retention-days: 1 + retention-days: 7 release: name: 🚀 Release From 886358f42191443b1d3d2d82b7881a08f1dfc1a9 Mon Sep 17 00:00:00 2001 From: "Kody (bot)" <72270156+kody-bot@users.noreply.github.com> Date: Tue, 12 May 2026 12:59:31 -0600 Subject: [PATCH 4/6] ci: include next-major in release gate --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eb7f3e8..ada984e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,7 +37,7 @@ jobs: contents: read if: ${{ github.repository == 'epicweb-dev/client-hints' && - contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha', + contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/next-major,refs/heads/alpha', github.ref) && github.event_name == 'push' }} steps: - name: ⬇️ Checkout repo @@ -74,7 +74,7 @@ jobs: pull-requests: write # to be able to comment on released pull requests if: ${{ github.repository == 'epicweb-dev/client-hints' && - contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha', + contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/next-major,refs/heads/alpha', github.ref) && github.event_name == 'push' }} steps: - name: ⬇️ Checkout repo From 5ee5556df27613a9a089c0c8655828cb57ffdfec Mon Sep 17 00:00:00 2001 From: "Kody (bot)" <72270156+kody-bot@users.noreply.github.com> Date: Tue, 12 May 2026 13:08:14 -0600 Subject: [PATCH 5/6] ci: align release workflow guards --- .github/workflows/release.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ada984e..783bbe4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,10 +35,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: read - if: - ${{ github.repository == 'epicweb-dev/client-hints' && - contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/next-major,refs/heads/alpha', - github.ref) && github.event_name == 'push' }} + if: ${{ github.repository == 'epicweb-dev/client-hints' && github.event_name == 'push' }} steps: - name: ⬇️ Checkout repo uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 @@ -72,10 +69,7 @@ jobs: id-token: write # to enable use of OIDC for npm provenance issues: write # to be able to comment on released issues pull-requests: write # to be able to comment on released pull requests - if: - ${{ github.repository == 'epicweb-dev/client-hints' && - contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/next-major,refs/heads/alpha', - github.ref) && github.event_name == 'push' }} + if: ${{ github.repository == 'epicweb-dev/client-hints' && github.event_name == 'push' }} steps: - name: ⬇️ Checkout repo uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 From 9adbf88cad7db0d2398a68d6a76f9cda5440c8f7 Mon Sep 17 00:00:00 2001 From: "Kody (bot)" <72270156+kody-bot@users.noreply.github.com> Date: Tue, 12 May 2026 17:15:15 -0600 Subject: [PATCH 6/6] ci: remove emoji from workflow step names --- .github/workflows/release.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 783bbe4..6f63516 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,20 +13,20 @@ jobs: name: 🧪 Test runs-on: ubuntu-latest steps: - - name: ⬇️ Checkout repo + - name: Checkout repo uses: actions/checkout@v5 - - name: ⎔ Setup node + - name: Setup node uses: actions/setup-node@v6 with: node-version: 20 - - name: 📥 Download deps + - name: Download deps uses: bahmutov/npm-install@v1 with: useLockFile: false - - name: 🧪 Test + - name: Test run: npm run test build-release-artifact: @@ -37,22 +37,22 @@ jobs: contents: read if: ${{ github.repository == 'epicweb-dev/client-hints' && github.event_name == 'push' }} steps: - - name: ⬇️ Checkout repo + - name: Checkout repo uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 - - name: ⎄ Setup node + - name: Setup node uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: node-version: lts/* package-manager-cache: false - - name: 📥 Install deps + - name: Install deps run: npm install --ignore-scripts - - name: 📦 Prepare package + - name: Prepare package run: npm run build - - name: 📦 Upload package artifact + - name: Upload package artifact uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: name: npm-package-artifact @@ -71,23 +71,23 @@ jobs: pull-requests: write # to be able to comment on released pull requests if: ${{ github.repository == 'epicweb-dev/client-hints' && github.event_name == 'push' }} steps: - - name: ⬇️ Checkout repo + - name: Checkout repo uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 - - name: ⎄ Setup node + - name: Setup node uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: node-version: 24 registry-url: https://registry.npmjs.org package-manager-cache: false - - name: 📦 Download package artifact + - name: Download package artifact uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 with: name: npm-package-artifact path: dist - - name: 🚀 Release + - name: Release uses: cycjimmy/semantic-release-action@ba330626c4750c19d8299de843f05c7aa5574f62 # v5.0.2 with: semantic_version: 25