From c18b91db03f8735b37afeaa439ee5ffb41035871 Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Sat, 21 Mar 2026 16:20:41 -0700 Subject: [PATCH] fix: extract publish workflow for manual triggering Split publish into a separate reusable workflow (publish.yml) that can be triggered manually via workflow_dispatch or called from release- please. This allows re-running publish independently when a release already exists but publishing failed. --- .github/workflows/publish.yml | 39 ++++++++++++++++++++++++++++ .github/workflows/release-please.yml | 33 ++--------------------- 2 files changed, 41 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..8a18aae4b --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,39 @@ +name: Publish to npm + +on: + workflow_call: + workflow_dispatch: + +permissions: + contents: read + id-token: write + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.3.1 + + - name: Setup Node.js + uses: actions/setup-node@v4.4.0 + with: + node-version: 22 + cache: npm + registry-url: https://registry.npmjs.org + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint -- --quiet + + - name: Test + run: npm test + + - name: Build + run: npm run build + + - name: Publish to npm + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm run npmpub diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index fc8611497..799ba606d 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -9,7 +9,6 @@ permissions: contents: write pull-requests: write issues: write - id-token: write jobs: release-please: @@ -28,35 +27,7 @@ jobs: manifest-file: .release-please-manifest.json publish: - runs-on: ubuntu-latest needs: release-please if: ${{ needs.release-please.outputs.release_created }} - permissions: - contents: read - id-token: write - steps: - - uses: actions/checkout@v4.3.1 - - - name: Setup Node.js - uses: actions/setup-node@v4.4.0 - with: - node-version: 22 - cache: npm - registry-url: https://registry.npmjs.org - - - name: Install dependencies - run: npm ci - - - name: Lint - run: npm run lint -- --quiet - - - name: Test - run: npm test - - - name: Build - run: npm run build - - - name: Publish to npm - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npm run npmpub + uses: ./.github/workflows/publish.yml + secrets: inherit