From 3e627949dad799694180a411105327109f10961e Mon Sep 17 00:00:00 2001 From: John Mitsch Date: Tue, 21 Apr 2026 12:41:41 -0400 Subject: [PATCH 1/3] mac release --- Justfile | 27 +++++++++++++++++++++++++++ README.md | 19 +++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/Justfile b/Justfile index 8073a74..0c3b5ec 100644 --- a/Justfile +++ b/Justfile @@ -46,6 +46,33 @@ macos-dist-ruby: @echo "Built Ruby bundle:" @file dist/quicknode_sdk.bundle +# Build macOS arm64 artifacts locally and upload to an existing GitHub release. +# Usage: just macos-build-and-publish 0.2.0 +# Precondition: tag vX.Y.Z has been pushed and CI has published the release. +macos-build-and-publish version: + #!/usr/bin/env bash + set -euo pipefail + if ! gh release view "v{{version}}" >/dev/null 2>&1; then + echo "Error: release v{{version}} not found. Push the tag and let CI publish it first." >&2 + exit 1 + fi + just macos-dist-python + just macos-dist-node + just macos-dist-ruby + # Stage the compiled bundle under ruby/lib so the platform gem picks it up, + # then build the arm64-darwin gem (mirrors .github/workflows/release.yml build-ruby). + cp dist/quicknode_sdk.bundle ruby/lib/quicknode_sdk.bundle + cd ruby && ruby -e " + spec = Gem::Specification.load('quicknode_sdk.gemspec') + spec.platform = Gem::Platform.new('arm64-darwin') + spec.extensions = [] + spec.files += ['lib/quicknode_sdk.bundle'] + File.write('quicknode_sdk_platform.gemspec', spec.to_ruby) + " && gem build quicknode_sdk_platform.gemspec && rm quicknode_sdk_platform.gemspec && cd .. + mv ruby/*.gem dist/ + gh release upload "v{{version}}" dist/*.whl dist/index.darwin-arm64.node dist/*.gem --clobber + echo "Uploaded macOS arm64 artifacts to v{{version}}" + test: cargo test -p sdk-core --lib diff --git a/README.md b/README.md index b58edbf..8c6c003 100644 --- a/README.md +++ b/README.md @@ -3433,6 +3433,25 @@ QN_SDK__API_KEY=replaceme ruby ruby/examples/admin_e2e.rb QN_SDK__API_KEY=replaceme ruby ruby/examples/streams.rb ``` +### Releasing + +macOS (Apple Silicon) artifacts are built locally rather than on GitHub Actions to avoid the ~10× runner cost. Linux artifacts are still built by CI on tag push. + +```bash +# 1. Bump versions, commit, tag +just release 0.2.0 + +# 2. Push +git push && git push origin v0.2.0 + +# 3. Wait for CI to finish and publish the GitHub release with Linux artifacts. + +# 4. Build macOS arm64 artifacts locally and append them to the release +just macos-build-and-publish 0.2.0 +``` + +Step 4 requires the [`gh` CLI](https://cli.github.com/) authenticated to the repo. Intel macOS (`x86_64-apple-darwin`) is not shipped — users on Intel Macs install from source. + ## License MIT From 0e4980612286a2a5d565eaa6d4db102decb0c422 Mon Sep 17 00:00:00 2001 From: John Mitsch Date: Tue, 21 Apr 2026 12:47:23 -0400 Subject: [PATCH 2/3] mac release --- Justfile | 10 ++-------- scripts/build-platform-gem.rb | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 8 deletions(-) create mode 100755 scripts/build-platform-gem.rb diff --git a/Justfile b/Justfile index 0c3b5ec..6bbca1d 100644 --- a/Justfile +++ b/Justfile @@ -60,15 +60,9 @@ macos-build-and-publish version: just macos-dist-node just macos-dist-ruby # Stage the compiled bundle under ruby/lib so the platform gem picks it up, - # then build the arm64-darwin gem (mirrors .github/workflows/release.yml build-ruby). + # then build the arm64-darwin gem. cp dist/quicknode_sdk.bundle ruby/lib/quicknode_sdk.bundle - cd ruby && ruby -e " - spec = Gem::Specification.load('quicknode_sdk.gemspec') - spec.platform = Gem::Platform.new('arm64-darwin') - spec.extensions = [] - spec.files += ['lib/quicknode_sdk.bundle'] - File.write('quicknode_sdk_platform.gemspec', spec.to_ruby) - " && gem build quicknode_sdk_platform.gemspec && rm quicknode_sdk_platform.gemspec && cd .. + cd ruby && ruby ../scripts/build-platform-gem.rb arm64-darwin lib/quicknode_sdk.bundle && gem build quicknode_sdk_platform.gemspec && rm quicknode_sdk_platform.gemspec && cd .. mv ruby/*.gem dist/ gh release upload "v{{version}}" dist/*.whl dist/index.darwin-arm64.node dist/*.gem --clobber echo "Uploaded macOS arm64 artifacts to v{{version}}" diff --git a/scripts/build-platform-gem.rb b/scripts/build-platform-gem.rb new file mode 100755 index 0000000..7ea923e --- /dev/null +++ b/scripts/build-platform-gem.rb @@ -0,0 +1,15 @@ +#!/usr/bin/env ruby +# Writes a temporary platform-specific gemspec (quicknode_sdk_platform.gemspec) +# that includes a prebuilt native library. Run from the ruby/ directory. +# +# Usage: ruby ../scripts/build-platform-gem.rb +# Example: ruby ../scripts/build-platform-gem.rb arm64-darwin lib/quicknode_sdk.bundle + +platform, lib_file = ARGV +abort "Usage: build-platform-gem.rb " unless platform && lib_file + +spec = Gem::Specification.load('quicknode_sdk.gemspec') +spec.platform = Gem::Platform.new(platform) +spec.extensions = [] +spec.files += [lib_file] +File.write('quicknode_sdk_platform.gemspec', spec.to_ruby) From 81b3712732e5c50d65488a78eafd144c59cdb0c6 Mon Sep 17 00:00:00 2001 From: John Mitsch Date: Tue, 21 Apr 2026 12:57:22 -0400 Subject: [PATCH 3/3] rm dist --- Justfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Justfile b/Justfile index 6bbca1d..185b701 100644 --- a/Justfile +++ b/Justfile @@ -56,6 +56,8 @@ macos-build-and-publish version: echo "Error: release v{{version}} not found. Push the tag and let CI publish it first." >&2 exit 1 fi + # Clean dist/ so stale artifacts from a previous version's build don't get uploaded. + rm -rf dist just macos-dist-python just macos-dist-node just macos-dist-ruby