From fb0ac50e0350de19b885dbcde60420c136c40050 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 5 Jan 2026 05:52:07 +0000 Subject: [PATCH] feat: add npm publishing and auto-finalize to release workflow - Add publish-npm job to publish package to npm registry - Add finalize-release job that undrafts the GitHub release after all publishing jobs complete successfully (crates.io, PyPI, npm, Homebrew) - Version is automatically synced from the git tag --- .github/workflows/release.yml | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8851d48..124cb56 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -217,6 +217,34 @@ jobs: env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + # ========================================================================== + # Publish to npm + # ========================================================================== + publish-npm: + name: Publish to npm + needs: [create-release, build-binaries] + runs-on: ubuntu-latest + environment: npm + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + registry-url: "https://registry.npmjs.org" + + - name: Update package version + run: | + VERSION="${{ needs.create-release.outputs.version }}" + VERSION_NUM="${VERSION#v}" + npm version "${VERSION_NUM}" --no-git-tag-version --allow-same-version + + - name: Publish to npm + run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + # ========================================================================== # Update Homebrew # ========================================================================== @@ -366,3 +394,24 @@ jobs: with: name: install-script path: install.sh + + # ========================================================================== + # Finalize release + # ========================================================================== + finalize-release: + name: Finalize Release + needs: + - create-release + - build-binaries + - publish-pypi + - publish-crates + - publish-npm + - update-homebrew + - generate-install-script + runs-on: ubuntu-latest + steps: + - name: Publish release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ needs.create-release.outputs.version }} + draft: false