v0.8.1 #58
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| build-rust: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Package crate | |
| run: cargo package -p quicknode-sdk --allow-dirty | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: rust-crate | |
| path: target/package/quicknode-sdk-*.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: | |
| # All Linux targets cross-build with zig so wheels link against an older | |
| # glibc (manylinux2014, glibc 2.17) instead of the ubuntu-latest runner's | |
| # glibc 2.39. Without this, the native x64 wheel would only load on | |
| # Ubuntu 24.04+ hosts. | |
| - target: x86_64-unknown-linux-gnu | |
| cross: true | |
| - 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: | |
| # gnu targets cross-build via `--use-cross`, which runs the build inside | |
| # rust-cross/cross's Docker image. Cross.toml's [build.zig] makes cross | |
| # use zig cc inside the image and pins glibc to 2.17 (manylinux2014). | |
| # musl targets cross-build via `--cross-compile`, which uses host zig + | |
| # cargo-zigbuild — musl is statically linked so no glibc pin needed. | |
| # Either path keeps us off the ubuntu-latest runner's glibc 2.39. | |
| - target: x86_64-unknown-linux-gnu | |
| cross: true | |
| - 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 && contains(matrix.target, 'musl') | |
| uses: goto-bus-stop/setup-zig@v2 | |
| - name: Install cargo-zigbuild | |
| if: matrix.cross && contains(matrix.target, 'musl') | |
| run: cargo install cargo-zigbuild --locked | |
| - name: Install cross | |
| if: matrix.cross && contains(matrix.target, 'gnu') | |
| run: cargo install cross --locked | |
| - 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 }} \ | |
| ${{ contains(matrix.target, 'gnu') && '--use-cross' || '--cross-compile' }} \ | |
| --manifest-path ../crates/node/Cargo.toml \ | |
| --output-dir . | |
| - 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 | |
| build-ruby: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # x86_64-unknown-linux-gnu uses cargo-zigbuild so the .so links against | |
| # an older glibc (manylinux2014, glibc 2.17) instead of the runner's | |
| # glibc 2.39. Without this, the native gem only loads on Ubuntu 24.04+. | |
| - target: x86_64-unknown-linux-gnu | |
| cross: true | |
| 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). | |
| # The pure-Ruby source gem (built below on x86_64-unknown-linux-gnu) ships no native | |
| # extension and exists only so Bundler's resolver has a `ruby`-platform fallback for | |
| # heterogeneous Gemfile.lock PLATFORMS lists. Users on platforms without a precompiled | |
| # platform gem (musl Linux, Windows) get a clear LoadError from lib/quicknode_sdk.rb at | |
| # first require, listing the supported platforms. | |
| # 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 }} | |
| mkdir -p ruby/lib/quicknode_sdk | |
| cp target/${{ matrix.target }}/release/libquicknode_sdk.so ruby/lib/quicknode_sdk/quicknode_sdk.so | |
| - name: Build native extension (native) | |
| if: '!matrix.cross' | |
| run: | | |
| cargo build --release -p sdk-ruby | |
| mkdir -p ruby/lib/quicknode_sdk | |
| cp target/release/libquicknode_sdk.so ruby/lib/quicknode_sdk/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/quicknode_sdk.so | |
| else | |
| strip ruby/lib/quicknode_sdk/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/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 | |
| 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/**/* | |
| tag_name: ${{ github.event.release.tag_name }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |