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