Skip to content

feat(ci): Add Release Pipeline (NPM)#13

Merged
Firaenix merged 9 commits into
mainfrom
release-pipeline
May 11, 2026
Merged

feat(ci): Add Release Pipeline (NPM)#13
Firaenix merged 9 commits into
mainfrom
release-pipeline

Conversation

@Firaenix
Copy link
Copy Markdown
Contributor

@Firaenix Firaenix commented Apr 16, 2026

Note

Medium Risk
Changes release automation and tagging/publishing behavior (GitHub Actions + release-plz), which can break release/versioning if misconfigured. No production runtime code paths are modified, but CI credentials/OIDC and version checks must be correct.

Overview
Adds an automated npm release pipeline for @bulletxyz/sdk-wasm: a new NPM Publish workflow builds on v* tags (or manual dispatch), verifies the tag semver matches wasm/Cargo.toml + wasm/package.json, then publishes with OIDC provenance and latest/rc tagging.

Updates release-plz to use a single workspace-wide v<version> tag, disables tag/release creation for the wasm crate, and adds a post-step that syncs the bumped Rust version into wasm/package.json on the release PR to keep npm and Cargo versions in lockstep.

Introduces a reusable composite Build action for WASM builds, centralizes workspace package metadata in the root Cargo.toml (and bumps resolver to 3), adds cargo-edit to the Nix dev shell, and extends wasm/package.json with build/prepublishOnly scripts to ensure local publishes build unless running in CI.

Reviewed by Cursor Bugbot for commit 059ac8f. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread justfile Outdated
Comment thread justfile Outdated
Comment thread .github/actions/build/action.yml
Comment thread .github/actions/build/action.yml Outdated
Comment on lines +5 to +8
github-app-token:
description: "GitHub App token for private git deps"
required: false
default: ""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not need this if all outputs are public.

Comment thread .github/actions/build/action.yml Outdated
Comment on lines +29 to +34
BULLET_APP_TOKEN: ${{ inputs.github-app-token }}
run: |
git config --global --add url."https://x-access-token:${BULLET_APP_TOKEN}@github.com/".insteadOf "ssh://git@github.com/"
git config --global --add url."https://x-access-token:${BULLET_APP_TOKEN}@github.com/".insteadOf "git@github.com:"
git config --global --add url."https://x-access-token:${BULLET_APP_TOKEN}@github.com/".insteadOf "https://github.com/"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which dependencies are needing these?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None, good point, this was copied from the old js sdk

Copy link
Copy Markdown
Contributor

@0xtristan 0xtristan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would address Bernhard and bugbot feedback

Comment thread Cargo.toml Outdated
@@ -2,6 +2,12 @@
members = ["rust", "wasm"]
resolver = "2"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can upgrade this to 3 now with latest rust versions (we just moved to rust 1.94)

Comment thread wasm/package.json
@Firaenix Firaenix closed this Apr 29, 2026
@Firaenix Firaenix deleted the release-pipeline branch April 29, 2026 09:34
@Firaenix Firaenix restored the release-pipeline branch April 29, 2026 09:35
@Firaenix Firaenix reopened this Apr 29, 2026
Comment thread justfile Outdated
Comment thread .github/workflows/npm-publish.yml Outdated
Comment thread .github/workflows/npm-publish.yml Outdated
Comment thread .github/workflows/npm-publish.yml Outdated
Comment thread .github/actions/build/action.yml Outdated
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 8 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="justfile">

<violation number="1" location="justfile:197">
P1: The `&&` chain suppresses `set -e` error handling. If `cd wasm` or `npm version` fails, the script silently continues instead of aborting—risking a publish with a mismatched version. Use separate statements or a subshell to ensure failures are caught:
```bash
(cd wasm && npm version "$V" --no-git-tag-version --allow-same-version)
```</violation>
</file>

<file name=".github/workflows/npm-publish.yml">

<violation number="1" location=".github/workflows/npm-publish.yml:75">
P1: OIDC trusted publishing will fail with `actions/setup-node@v4`. When `registry-url` is set, v4 exports a placeholder `NODE_AUTH_TOKEN` (`XXXXX-XXXXX-XXXXX-XXXXX`) that takes precedence over OIDC token negotiation, causing `npm publish` to fail with a 404. This was fixed in `actions/setup-node@v6` (see [setup-node#1477](https://github.com/actions/setup-node/pull/1477)). Either upgrade to `actions/setup-node@v6` in the composite action, or set `NODE_AUTH_TOKEN: ""` in the environment of this publish step as a workaround.</violation>

<violation number="2" location=".github/workflows/npm-publish.yml:81">
P1: `Cargo.lock` is tracked but not included in `git add`. After `cargo set-version --workspace --bump` updates all crate versions, the lock file will be modified but left uncommitted, causing version mismatch between `Cargo.toml` files and `Cargo.lock` on the release branch.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

Comment thread justfile Outdated
Comment thread .github/workflows/npm-publish.yml Outdated
Comment thread .github/workflows/npm-publish.yml Outdated
- name: Install cargo-edit
run: cargo binstall cargo-edit -y

- name: Bump + publish to npm
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot May 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: OIDC trusted publishing will fail with actions/setup-node@v4. When registry-url is set, v4 exports a placeholder NODE_AUTH_TOKEN (XXXXX-XXXXX-XXXXX-XXXXX) that takes precedence over OIDC token negotiation, causing npm publish to fail with a 404. This was fixed in actions/setup-node@v6 (see setup-node#1477). Either upgrade to actions/setup-node@v6 in the composite action, or set NODE_AUTH_TOKEN: "" in the environment of this publish step as a workaround.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/npm-publish.yml, line 75:

<comment>OIDC trusted publishing will fail with `actions/setup-node@v4`. When `registry-url` is set, v4 exports a placeholder `NODE_AUTH_TOKEN` (`XXXXX-XXXXX-XXXXX-XXXXX`) that takes precedence over OIDC token negotiation, causing `npm publish` to fail with a 404. This was fixed in `actions/setup-node@v6` (see [setup-node#1477](https://github.com/actions/setup-node/pull/1477)). Either upgrade to `actions/setup-node@v6` in the composite action, or set `NODE_AUTH_TOKEN: ""` in the environment of this publish step as a workaround.</comment>

<file context>
@@ -0,0 +1,84 @@
+      - name: Install cargo-edit
+        run: cargo binstall cargo-edit -y
+
+      - name: Bump + publish to npm
+        run: just publish-wasm ${{ inputs.level }}
+
</file context>
Fix with Cubic

Comment thread .github/workflows/npm-publish.yml
Comment thread Cargo.toml Outdated
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 4 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="wasm/package.json">

<violation number="1" location="wasm/package.json:24">
P2: The test script drops `--experimental-vm-modules`, but this package is configured to run Jest in ESM mode (`type: module` + `ts-jest` `useESM: true`). Re-add the flag so Jest can execute ESM tests reliably.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic

Comment thread wasm/package.json Outdated
@Firaenix Firaenix enabled auto-merge (squash) May 11, 2026 14:25
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 059ac8f. Configure here.

uses: Swatinem/rust-cache@v2

- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@main
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unpinned third-party action in release publish pipeline

Medium Severity

cargo-bins/cargo-binstall@main references a mutable branch rather than a commit SHA, unlike the other actions in this pipeline (e.g., actions/checkout and actions/setup-node are SHA-pinned). Since this composite action is used in the npm-publish.yml workflow that has id-token: write permission and publishes to npm with provenance, a compromised main branch in the cargo-binstall repo could inject malicious code into the published package. At minimum, the version input available on this action could be set to pin the installed binary version.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 059ac8f. Configure here.

@Firaenix Firaenix requested a review from conwayconstar May 11, 2026 14:39
@Firaenix Firaenix merged commit b033f9b into main May 11, 2026
7 checks passed
@Firaenix Firaenix deleted the release-pipeline branch May 11, 2026 14:40
@bullet-release bullet-release Bot mentioned this pull request May 11, 2026
This was referenced May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants