From 4acdedf6bdac3c54f9963255f354517b33af7914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Lojhan?= Date: Thu, 22 Oct 2026 17:52:39 +0000 Subject: [PATCH 1/2] chore: serialize releases and support tagged publish retries --- .github/workflows/cd_publish.yml | 64 +++++++++++++++++++------------- .release-please-manifest.json | 3 ++ release-please-config.json | 7 ++++ 3 files changed, 49 insertions(+), 25 deletions(-) create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/cd_publish.yml b/.github/workflows/cd_publish.yml index 8b37f41..d772760 100644 --- a/.github/workflows/cd_publish.yml +++ b/.github/workflows/cd_publish.yml @@ -1,10 +1,19 @@ -name: '🚀 CD — Publish' +name: "🚀 CD — Publish" on: push: branches: - main workflow_dispatch: + inputs: + tag: + description: "Existing release tag to publish or retry" + required: false + type: string + +concurrency: + group: npm-publish-${{ github.repository }} + cancel-in-progress: false permissions: contents: write @@ -14,50 +23,55 @@ permissions: jobs: release-please: + if: github.event.repository.fork == false && !inputs.tag runs-on: ubuntu-latest timeout-minutes: 15 - if: github.event.repository.fork == false - name: Release Please + outputs: + created: ${{ steps.release.outputs.release_created }} + tag: ${{ steps.release.outputs.tag_name }} steps: - name: 🤝 Release Please - uses: google-github-actions/release-please-action@v3 + uses: googleapis/release-please-action@v4 id: release with: token: ${{ secrets.GITHUB_TOKEN }} - release-type: node - package-name: '@pokujs/shared-resources' - changelog-path: 'CHANGELOG.md' - - name: ➕ Actions - Checkout + publish: + needs: release-please + if: always() && github.event.repository.fork == false && (inputs.tag || needs.release-please.outputs.created == 'true') + runs-on: ubuntu-latest + timeout-minutes: 15 + env: + RELEASE_TAG: ${{ inputs.tag || needs.release-please.outputs.tag }} + steps: + - name: ➕ Actions - Checkout release uses: actions/checkout@v4 - if: ${{ steps.release.outputs.releases_created }} + with: + ref: ${{ env.RELEASE_TAG }} - name: ➕ Actions - Setup Node.js uses: actions/setup-node@v4 - if: ${{ steps.release.outputs.releases_created }} with: - check-latest: true - node-version: lts/* - registry-url: 'https://registry.npmjs.org' + node-version: "24" + registry-url: "https://registry.npmjs.org" + cache: npm - - name: ➕ Cache dependencies - uses: actions/cache@v4 - if: ${{ steps.release.outputs.releases_created }} - with: - path: ~/.npm - key: npm-linux-${{ hashFiles('package-lock.json') }} - restore-keys: npm-linux- + - name: ✅ Verify release version + run: node -e 'const { version } = require("./package.json"); if (process.env.RELEASE_TAG !== `v${version}`) throw new Error("Release tag must match the package version.");' - name: 📦 Installing Dependencies - if: ${{ steps.release.outputs.releases_created }} run: npm ci - - name: 🚀 Building Poku - if: ${{ steps.release.outputs.releases_created }} + - name: ✅ Validate + run: npm run lint && npm test + + - name: 🚀 Building run: npm run build + - name: 📦 Validate package + run: npm pack --dry-run + - name: 📥 Publishing Package - if: ${{ steps.release.outputs.releases_created }} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npm publish --provenance + run: npm publish --provenance --access public diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..d719a72 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "1.1.3" +} diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..9c33b5e --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,7 @@ +{ + "release-type": "node", + "include-component-in-tag": false, + "packages": { + ".": {} + } +} From 97db083754fd8667c2dbfb7e3a45b93320e84a27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Lojhan?= Date: Thu, 22 Oct 2026 17:53:41 +0000 Subject: [PATCH 2/2] chore: format the publishing workflow --- .github/workflows/cd_publish.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cd_publish.yml b/.github/workflows/cd_publish.yml index d772760..0bbe6b3 100644 --- a/.github/workflows/cd_publish.yml +++ b/.github/workflows/cd_publish.yml @@ -1,4 +1,4 @@ -name: "🚀 CD — Publish" +name: '🚀 CD — Publish' on: push: @@ -7,7 +7,7 @@ on: workflow_dispatch: inputs: tag: - description: "Existing release tag to publish or retry" + description: 'Existing release tag to publish or retry' required: false type: string @@ -52,8 +52,8 @@ jobs: - name: ➕ Actions - Setup Node.js uses: actions/setup-node@v4 with: - node-version: "24" - registry-url: "https://registry.npmjs.org" + node-version: '24' + registry-url: 'https://registry.npmjs.org' cache: npm - name: ✅ Verify release version