Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 23 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,29 @@ 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
# 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
# Stage the compiled bundle under ruby/lib so the platform gem picks it up,
# then build the arm64-darwin gem.
cp dist/quicknode_sdk.bundle ruby/lib/quicknode_sdk.bundle
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
Comment thread
cursor[bot] marked this conversation as resolved.
echo "Uploaded macOS arm64 artifacts to v{{version}}"

test:
cargo test -p sdk-core --lib

Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 15 additions & 0 deletions scripts/build-platform-gem.rb
Original file line number Diff line number Diff line change
@@ -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 <platform> <lib_file>
# Example: ruby ../scripts/build-platform-gem.rb arm64-darwin lib/quicknode_sdk.bundle

platform, lib_file = ARGV
abort "Usage: build-platform-gem.rb <platform> <lib_file>" 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)
Loading