Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
87a7f50
feat: draft surfpool-sdk
lgalabru Mar 28, 2026
5a51884
feat(sdk): add test report generation and cheatcode improvements
lgalabru Mar 29, 2026
97fbcf2
feat(sdk-node): Node.js bindings for surfpool-sdk via napi-rs
lgalabru Mar 29, 2026
a91f9fb
feat: reusable GitHub Actions for test reports and coverage
lgalabru Mar 29, 2026
a477f3f
feat(sdk): add SurfpoolReport::generate() convenience method
lgalabru Mar 29, 2026
4a256ac
fix(sdk-node): point main at internal.js for direct napi import
lgalabru Mar 29, 2026
1243cef
refactor: single test-report action replacing coverage + report
lgalabru Mar 29, 2026
3dcb436
rename: Surfpool Test Report → Surfpool Report
lgalabru Mar 29, 2026
65f7fff
fix: revamp report test generation to pull from surfpool-web-ui
MicaiahReid Apr 3, 2026
b1c6030
feat: enhance sdk cheatcodes; add builder pattern
MicaiahReid Apr 3, 2026
a8fd31c
chore: update sdk docs
MicaiahReid Apr 3, 2026
25b9ed3
feat: add program deployment patterns to sdk
MicaiahReid Apr 3, 2026
2f86fbc
chore: bring sdk-node to parity with sdk
MicaiahReid Apr 3, 2026
6f2723f
ci: sdk-node build
MicaiahReid Apr 6, 2026
865ddb0
chore: return program pubkey on deploy
MicaiahReid Apr 10, 2026
cde9a2f
fix: implement target directory resolution for program deployment
MicaiahReid Apr 10, 2026
6df5708
fix: sdk build.rs to pull from latest dist upload
MicaiahReid Apr 10, 2026
1ec2668
fix sdk-node build
MicaiahReid Apr 10, 2026
bbb1e4e
update sdk-node with latest interface
MicaiahReid Apr 10, 2026
b9839d6
fmt
MicaiahReid Apr 10, 2026
379a8f8
fix CI
MicaiahReid Apr 10, 2026
77de081
use latest macos for ci
MicaiahReid Apr 10, 2026
b1f3b90
fix sdk tests
MicaiahReid Apr 10, 2026
6426d9c
silence rust analyzer
MicaiahReid Apr 10, 2026
e7f2a28
add surfpool web ui version to ci
MicaiahReid Apr 10, 2026
dc751eb
clean up sdk interface
MicaiahReid Apr 10, 2026
e0204c2
fix test imports
MicaiahReid Apr 10, 2026
7694575
chore: remove test report generation action
MicaiahReid Apr 14, 2026
413de70
chore: remove reporting functionality from sdk
MicaiahReid Apr 14, 2026
953b178
fix doc tests
MicaiahReid Apr 15, 2026
27f31ec
chore: remove errant `no_run` from doc comments
MicaiahReid Apr 16, 2026
6922e55
fix(sdk-node): update to have feature parity with rust sdk
MicaiahReid Apr 20, 2026
d563bef
test(sdk-node): improve smoke test
MicaiahReid Apr 20, 2026
d07eb21
docs(sdk-node): update readme
MicaiahReid Apr 20, 2026
d3f6c97
ci: update publish conditions and node version for SDK packages
MicaiahReid Apr 20, 2026
5177783
fix(ci): sdk-node smoke test
MicaiahReid Apr 21, 2026
39cc33d
fmt
MicaiahReid Apr 21, 2026
b00b3fa
fix(sdk): add startup airdrop balance checks
MicaiahReid Apr 21, 2026
eae4694
test(sdk-node): fix startup balance
MicaiahReid Apr 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/release_crates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
environment: release

permissions:
contents: read
id-token: write

steps:
Expand Down Expand Up @@ -52,7 +53,7 @@ jobs:
if [ -n "${{ inputs.crates }}" ]; then
CRATES="${{ inputs.crates }}"
else
CRATES="surfpool-types surfpool-db surfpool-core surfpool-studio-ui"
CRATES="surfpool-types surfpool-db surfpool-core surfpool-sdk surfpool-studio-ui"
fi

for CRATE in $CRATES; do
Expand Down
258 changes: 258 additions & 0 deletions .github/workflows/release_sdk_node_npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
name: Publish SDK Node Package

on:
workflow_dispatch:
inputs:
dry_run:
description: "Dry run (do not actually publish to npm)"
required: false
type: boolean
default: false

env:
CARGO_TERM_COLOR: always
SURFPOOL_WEB_UI_VERSION: 0.2.0-alpha.0

jobs:
prepare_release:
name: Prepare Release
runs-on: ubuntu-latest
outputs:
version: ${{ steps.package.outputs.version }}
publish_root: ${{ steps.package.outputs.publish_root }}
publish_darwin_x64: ${{ steps.package.outputs.publish_darwin_x64 }}
publish_darwin_arm64: ${{ steps.package.outputs.publish_darwin_arm64 }}
publish_linux_x64_gnu: ${{ steps.package.outputs.publish_linux_x64_gnu }}
should_publish: ${{ steps.package.outputs.should_publish }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22.14.0
registry-url: https://registry.npmjs.org

- name: Ensure npm 11
run: |
npm install -g npm@^11.10.0
npm --version

- name: Read package version
id: package
working-directory: crates/sdk-node
shell: bash
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
SHOULD_PUBLISH=false

for ENTRY in \
"surfpool-sdk publish_root" \
"surfpool-sdk-darwin-x64 publish_darwin_x64" \
"surfpool-sdk-darwin-arm64 publish_darwin_arm64" \
"surfpool-sdk-linux-x64-gnu publish_linux_x64_gnu"
do
PACKAGE_NAME="${ENTRY% *}"
OUTPUT_NAME="${ENTRY#* }"

if npm view "${PACKAGE_NAME}@${VERSION}" version --registry=https://registry.npmjs.org >/dev/null 2>&1; then
echo "${OUTPUT_NAME}=false" >> "$GITHUB_OUTPUT"
echo "${PACKAGE_NAME}@${VERSION} is already published"
else
echo "${OUTPUT_NAME}=true" >> "$GITHUB_OUTPUT"
echo "${PACKAGE_NAME}@${VERSION} is ready to publish"
SHOULD_PUBLISH=true
fi
done

echo "should_publish=${SHOULD_PUBLISH}" >> "$GITHUB_OUTPUT"

build_artifacts:
name: Build (${{ matrix.name }})
needs: prepare_release
if: needs.prepare_release.outputs.should_publish == 'true'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: linux-x64
os: ubuntu-22.04
upload_metadata: true
platform_dir: linux-x64-gnu
- name: macos-x64
os: macos-15-intel
upload_metadata: false
platform_dir: darwin-x64
- name: macos-arm64
os: macos-15
upload_metadata: false
platform_dir: darwin-arm64

steps:
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libudev-dev clang libclang-dev

- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache Rust artifacts
uses: Swatinem/rust-cache@v2
with:
workspaces: |
. -> target

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22.14.0
cache: npm
cache-dependency-path: crates/sdk-node/package-lock.json

- name: Install npm dependencies
working-directory: crates/sdk-node
run: npm ci

- name: Build npm package
working-directory: crates/sdk-node
run: npm run build

- name: Smoke test package
working-directory: crates/sdk-node
run: npm run smoke

- name: Upload native binary
uses: actions/upload-artifact@v4
with:
name: sdk-node-${{ matrix.name }}-binary
path: crates/sdk-node/surfpool-sdk.*.node
if-no-files-found: error

- name: Upload package metadata
if: matrix.upload_metadata
uses: actions/upload-artifact@v4
with:
name: sdk-node-package-metadata
path: |
crates/sdk-node/surfpool-sdk/internal.js
crates/sdk-node/surfpool-sdk/internal.d.ts
if-no-files-found: error

publish:
name: Publish To npm
needs:
- prepare_release
- build_artifacts
if: needs.prepare_release.outputs.should_publish == 'true'
runs-on: ubuntu-latest
environment: release
permissions:
contents: read
id-token: write
steps:
- name: Install Linux dependencies
run: sudo apt-get update && sudo apt-get install -y libudev-dev clang libclang-dev

- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22.14.0
registry-url: https://registry.npmjs.org
cache: npm
cache-dependency-path: crates/sdk-node/package-lock.json

- name: Ensure npm 11
run: |
npm install -g npm@^11.10.0
npm --version

- name: Install npm dependencies
working-directory: crates/sdk-node
run: npm ci

- name: Download native binaries
uses: actions/download-artifact@v4
with:
pattern: sdk-node-*-binary
path: crates/sdk-node/artifacts

- name: Download package metadata
uses: actions/download-artifact@v4
with:
name: sdk-node-package-metadata
path: crates/sdk-node/surfpool-sdk

- name: Create npm platform package directories
working-directory: crates/sdk-node
run: npm run create-npm-dir

- name: Copy artifacts into npm platform packages
working-directory: crates/sdk-node
run: npm run artifacts

- name: Build TypeScript wrapper
working-directory: crates/sdk-node
run: npm run build:ts

- name: Pack root npm tarball
working-directory: crates/sdk-node
run: NPM_CONFIG_CACHE=$(mktemp -d) npm pack --dry-run

- name: Pack platform npm tarballs
working-directory: crates/sdk-node
run: |
cd npm/darwin-x64 && NPM_CONFIG_CACHE=$(mktemp -d) npm pack --dry-run
cd ../darwin-arm64 && NPM_CONFIG_CACHE=$(mktemp -d) npm pack --dry-run
cd ../linux-x64-gnu && NPM_CONFIG_CACHE=$(mktemp -d) npm pack --dry-run

- name: Publish darwin-x64 package
if: inputs.dry_run != true && needs.prepare_release.outputs.publish_darwin_x64 == 'true'
working-directory: crates/sdk-node/npm/darwin-x64
run: npm publish --access public --provenance

- name: Publish darwin-arm64 package
if: inputs.dry_run != true && needs.prepare_release.outputs.publish_darwin_arm64 == 'true'
working-directory: crates/sdk-node/npm/darwin-arm64
run: npm publish --access public --provenance

- name: Publish linux-x64-gnu package
if: inputs.dry_run != true && needs.prepare_release.outputs.publish_linux_x64_gnu == 'true'
working-directory: crates/sdk-node/npm/linux-x64-gnu
run: npm publish --access public --provenance

- name: Dry run darwin-x64 publish
if: inputs.dry_run == true && needs.prepare_release.outputs.publish_darwin_x64 == 'true'
working-directory: crates/sdk-node/npm/darwin-x64
run: npm publish --dry-run --access public

- name: Dry run darwin-arm64 publish
if: inputs.dry_run == true && needs.prepare_release.outputs.publish_darwin_arm64 == 'true'
working-directory: crates/sdk-node/npm/darwin-arm64
run: npm publish --dry-run --access public

- name: Dry run linux-x64-gnu publish
if: inputs.dry_run == true && needs.prepare_release.outputs.publish_linux_x64_gnu == 'true'
working-directory: crates/sdk-node/npm/linux-x64-gnu
run: npm publish --dry-run --access public

- name: Publish root package
if: inputs.dry_run != true && needs.prepare_release.outputs.publish_root == 'true'
working-directory: crates/sdk-node
run: npm publish --access public --provenance

- name: Dry run root publish
if: inputs.dry_run == true && needs.prepare_release.outputs.publish_root == 'true'
working-directory: crates/sdk-node
run: npm publish --dry-run --access public
Loading
Loading