diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index fe0bdf2..f29517b 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -4,8 +4,6 @@ on: branches: [main] paths-ignore: [bin.json] workflow_dispatch: -env: - MACOS_SDK: "14.5" jobs: # next version = highest vX.Y.Z tag with the patch bumped; push a tag by hand for minor/major version: @@ -33,28 +31,22 @@ jobs: fail-fast: false matrix: target: [x86_64-unknown-linux-musl, aarch64-apple-darwin] + # rust, zig, cargo-zigbuild, both targets and a macOS SDK (SDKROOT) prebuilt; + # the runner keeps the pulled image, so no per-run toolchain/SDK setup + container: + image: ghcr.io/rust-cross/cargo-zigbuild:0.24.1 steps: + # the image has no node, which act_runner needs for the JS actions below + - run: | + case "$(uname -m)" in x86_64) a=x64 ;; aarch64) a=arm64 ;; esac + curl -fsSL "https://nodejs.org/dist/v22.11.0/node-v22.11.0-linux-$a.tar.xz" \ + | tar -xJ -C /usr/local --strip-components=1 - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ matrix.target }} - # caches ~/.cargo registry/git and target/, keyed on Cargo.lock + toolchain + # caches ~/.cargo registry/git and target/, keyed on Cargo.lock + toolchain; + # a no-op until the runner's cache server is enabled - uses: Swatinem/rust-cache@v2 with: key: ${{ matrix.target }} - # zig as cross C compiler/linker for both musl and macOS (rusqlite bundles sqlite) - - run: pip install ziglang cargo-zigbuild - # macOS: Apple SDK for system frameworks - - if: matrix.target == 'aarch64-apple-darwin' - id: sdk-cache - uses: actions/cache@v4 - with: - path: ~/MacOSX${{ env.MACOS_SDK }}.sdk - key: macos-sdk-${{ env.MACOS_SDK }} - - if: matrix.target == 'aarch64-apple-darwin' && steps.sdk-cache.outputs.cache-hit != 'true' - run: curl -fsSL "https://github.com/joseluisq/macosx-sdks/releases/download/${MACOS_SDK}/MacOSX${MACOS_SDK}.sdk.tar.xz" | tar -xJ -C "$HOME" - - if: matrix.target == 'aarch64-apple-darwin' - run: echo "SDKROOT=$HOME/MacOSX${MACOS_SDK}.sdk" >> "$GITHUB_ENV" - run: cargo zigbuild --release --locked --target ${{ matrix.target }} env: ORCH_VERSION: ${{ needs.version.outputs.version }}