-
Notifications
You must be signed in to change notification settings - Fork 0
Ci #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ci #2
Changes from all commits
dd22992
a9c5007
b7cdbda
649050b
268b1f3
71b81c4
0f50639
bf1105f
b571f36
977dced
6b0a1b4
f0495d1
2512b0f
2e9203e
778c6b6
f08a0d0
28853dd
cae5c55
182013e
f6d12ad
d13d2e6
996c643
d10dd0f
f38d066
62c542f
e9d1cfc
3887d1f
35408e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,246 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
|
|
||
| jobs: | ||
| build-rust: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: dtolnay/rust-toolchain@stable | ||
|
|
||
| - name: Package crate | ||
| run: cargo package -p sdk-core --allow-dirty | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: rust-crate | ||
| path: target/package/sdk-core-*.crate | ||
|
|
||
| build-python: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ['3.11', '3.12', '3.13', '3.14'] | ||
| target: | ||
| - x86_64-unknown-linux-gnu | ||
| - aarch64-unknown-linux-gnu | ||
| - x86_64-unknown-linux-musl | ||
| - aarch64-unknown-linux-musl | ||
| # Placeholder for future macOS support: | ||
| # - aarch64-apple-darwin | ||
| include: | ||
| - target: x86_64-unknown-linux-gnu | ||
| cross: false | ||
| - target: aarch64-unknown-linux-gnu | ||
| cross: true | ||
| - target: x86_64-unknown-linux-musl | ||
| cross: true | ||
| - target: aarch64-unknown-linux-musl | ||
| cross: true | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| targets: ${{ matrix.target }} | ||
|
|
||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install maturin | ||
| run: pip install "maturin>=1.5,<2.0" | ||
|
|
||
| - name: Install Zig | ||
| if: matrix.cross | ||
| uses: goto-bus-stop/setup-zig@v2 | ||
|
|
||
| - name: Build wheel | ||
| run: | | ||
| maturin build --release \ | ||
| --strip \ | ||
| --target ${{ matrix.target }} \ | ||
| ${{ matrix.cross && '--zig' || '' }} \ | ||
| -i python${{ matrix.python-version }} \ | ||
| --out dist/ | ||
|
|
||
| - name: Build sdist | ||
| if: matrix.target == 'x86_64-unknown-linux-gnu' && matrix.python-version == '3.11' | ||
| run: maturin sdist --out dist/ | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: python-${{ matrix.target }}-py${{ matrix.python-version }} | ||
| path: dist/* | ||
|
|
||
| build-node: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| target: | ||
| - x86_64-unknown-linux-gnu | ||
| - aarch64-unknown-linux-gnu | ||
| - x86_64-unknown-linux-musl | ||
| - aarch64-unknown-linux-musl | ||
| # Placeholder for future macOS support: | ||
| # - aarch64-apple-darwin | ||
| include: | ||
| - target: x86_64-unknown-linux-gnu | ||
| cross: false | ||
| - target: aarch64-unknown-linux-gnu | ||
| cross: true | ||
| - target: x86_64-unknown-linux-musl | ||
| cross: true | ||
| - target: aarch64-unknown-linux-musl | ||
| cross: true | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| targets: ${{ matrix.target }} | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
|
|
||
| - name: Install Zig | ||
| if: matrix.cross | ||
| uses: goto-bus-stop/setup-zig@v2 | ||
|
|
||
| - name: Install npm dependencies | ||
| working-directory: npm | ||
| run: npm install | ||
|
|
||
| - name: Build native module | ||
| working-directory: npm | ||
| run: | | ||
| npx napi build --release \ | ||
| --platform \ | ||
| --target ${{ matrix.target }} \ | ||
| --cargo-cwd ../crates/node | ||
|
|
||
| - name: Strip debug symbols | ||
| run: | | ||
| if [ "${{ matrix.cross }}" = "true" ]; then | ||
| sudo apt-get install -y llvm | ||
| llvm-strip npm/index.*.node | ||
| else | ||
| strip npm/index.*.node | ||
| fi | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: node-${{ matrix.target }} | ||
| path: npm/index.*.node | ||
|
cursor[bot] marked this conversation as resolved.
|
||
|
|
||
| build-ruby: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - target: x86_64-unknown-linux-gnu | ||
| cross: false | ||
| gem_platform: x86_64-linux | ||
| - target: aarch64-unknown-linux-gnu | ||
| cross: true | ||
| gem_platform: aarch64-linux | ||
| # musl targets are excluded: Rust cdylib is incompatible with musl (no dynamic linker). | ||
| # Users on musl Linux (e.g. Alpine) will use the source gem which compiles on install. | ||
| # Placeholder for future macOS support: | ||
| # - target: aarch64-apple-darwin | ||
| # cross: false | ||
| # gem_platform: arm64-darwin | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| targets: ${{ matrix.target }} | ||
|
|
||
| - uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: '3.3' | ||
|
|
||
| - name: Install Zig | ||
| if: matrix.cross | ||
| uses: goto-bus-stop/setup-zig@v2 | ||
|
|
||
| - name: Install cargo-zigbuild | ||
| if: matrix.cross | ||
| run: cargo install cargo-zigbuild | ||
|
|
||
| - name: Build native extension (cross) | ||
| if: matrix.cross | ||
| run: | | ||
| cargo zigbuild --release -p sdk-ruby --target ${{ matrix.target }} | ||
| cp target/${{ matrix.target }}/release/libquicknode_sdk.so ruby/lib/quicknode_sdk.so | ||
|
|
||
| - name: Build native extension (native) | ||
| if: '!matrix.cross' | ||
| run: | | ||
| cargo build --release -p sdk-ruby | ||
| cp target/release/libquicknode_sdk.so ruby/lib/quicknode_sdk.so | ||
|
|
||
| - name: Strip debug symbols | ||
| run: | | ||
| if [ "${{ matrix.cross }}" = "true" ]; then | ||
| sudo apt-get install -y llvm | ||
| llvm-strip ruby/lib/quicknode_sdk.so | ||
| else | ||
| strip ruby/lib/quicknode_sdk.so | ||
| fi | ||
|
|
||
| - name: Build platform gem | ||
| working-directory: ruby | ||
| run: | | ||
| ruby -e " | ||
| spec = Gem::Specification.load('quicknode_sdk.gemspec') | ||
| spec.platform = Gem::Platform.new('${{ matrix.gem_platform }}') | ||
| spec.extensions = [] | ||
| spec.files += ['lib/quicknode_sdk.so'] | ||
| File.write('quicknode_sdk_platform.gemspec', spec.to_ruby) | ||
| " | ||
| gem build quicknode_sdk_platform.gemspec | ||
| rm quicknode_sdk_platform.gemspec | ||
|
|
||
| - name: Build source gem | ||
| if: matrix.target == 'x86_64-unknown-linux-gnu' | ||
| working-directory: ruby | ||
| run: gem build quicknode_sdk.gemspec | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ruby-${{ matrix.target }} | ||
| path: ruby/*.gem | ||
|
|
||
| release: | ||
| needs: [build-rust, build-python, build-node, build-ruby] | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| path: artifacts/ | ||
| merge-multiple: true | ||
|
|
||
| - uses: softprops/action-gh-release@v2 | ||
| with: | ||
| files: artifacts/**/* | ||
| generate_release_notes: true | ||
| draft: false | ||
| prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-beta') }} | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,9 @@ version.workspace = true | |
| edition.workspace = true | ||
| license.workspace = true | ||
| description = "Core library for quicknode sdk" | ||
| repository = "https://github.com/quiknode-labs/sdk" | ||
| keywords = ["quicknode", "blockchain", "web3", "sdk"] | ||
| categories = ["api-bindings", "web-programming"] | ||
|
|
||
| [lints] | ||
| workspace = true | ||
|
|
@@ -19,7 +22,7 @@ extension-module = ["pyo3/extension-module"] | |
| thiserror = "1.0" | ||
| serde = { version = "1.0", features = ["derive"] } | ||
| serde_json = "1.0" | ||
| reqwest = { version = "0.13.2", features = ["json", "query"] } | ||
| reqwest = { version = "0.13.2", default-features = false, features = ["json", "query", "rustls", "http2"] } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dropped
|
||
| pyo3 = { workspace = true, optional = true, features = ["experimental-async"] } | ||
| pyo3-async-runtimes = { workspace = true, optional = true, features = ["tokio-runtime"] } | ||
| napi = { workspace = true, optional = true, features = ["async", "tokio_rt"] } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // Native Node.js bindings (.node files compiled from Rust) cannot run in | ||
| // browser environments — they are binary extensions that require the Node.js | ||
| // runtime and OS-level dynamic linking. Bundlers (Webpack, Vite, etc.) that | ||
| // encounter this package in a browser target will load this shim instead, | ||
| // producing a clear error rather than a cryptic binary load failure. | ||
| throw new Error( | ||
| '@quicknode/sdk-next does not support browser environments. ' + | ||
| 'This package requires Node.js.' | ||
| ); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.


Uh oh!
There was an error while loading. Please reload this page.