diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 067da99..a0bc826 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,15 +34,21 @@ jobs: with: version: "0.14.0" # fixes zig cc cache race in 0.13.0 - run: cargo install cargo-zigbuild --version 0.19.2 + - name: Pre-warm zig cc cache + env: + ZIG_LOCAL_CACHE_DIR: ${{ runner.temp }}/zig-cache + run: | + echo 'int main(void) { return 0; }' > /tmp/zigwarm.c + zig cc --target=x86_64-unknown-linux-gnu -c /tmp/zigwarm.c -o /tmp/zigwarm.o - name: Build embedded astgrep (target) env: - ZIG_GLOBAL_CACHE_DIR: ${{ runner.temp }}/zig-cache + ZIG_LOCAL_CACHE_DIR: ${{ runner.temp }}/zig-cache run: cargo zigbuild --manifest-path lib/astgrep/Cargo.toml --release --target x86_64-unknown-linux-gnu.2.17 - name: Build coderc (embed-astgrep) env: ASTGREP_RELEASE_BIN: ${{ github.workspace }}/lib/astgrep/target/x86_64-unknown-linux-gnu/release/astgrep CARGO_BUILD_EMBED_REQUIRED: "1" - ZIG_GLOBAL_CACHE_DIR: ${{ runner.temp }}/zig-cache + ZIG_LOCAL_CACHE_DIR: ${{ runner.temp }}/zig-cache run: cargo zigbuild -p cr-cli --release --target x86_64-unknown-linux-gnu.2.17 --features cr-audit-static/embed-astgrep - run: strip target/x86_64-unknown-linux-gnu/release/${{ env.BINARY_NAME }} - run: | @@ -72,15 +78,21 @@ jobs: with: version: "0.14.0" # fixes zig cc cache race in 0.13.0 - run: cargo install cargo-zigbuild --version 0.19.2 + - name: Pre-warm zig cc cache + env: + ZIG_LOCAL_CACHE_DIR: ${{ runner.temp }}/zig-cache + run: | + echo 'int main(void) { return 0; }' > /tmp/zigwarm.c + zig cc --target=aarch64-unknown-linux-gnu -c /tmp/zigwarm.c -o /tmp/zigwarm.o - name: Build embedded astgrep (target) env: - ZIG_GLOBAL_CACHE_DIR: ${{ runner.temp }}/zig-cache + ZIG_LOCAL_CACHE_DIR: ${{ runner.temp }}/zig-cache run: cargo zigbuild --manifest-path lib/astgrep/Cargo.toml --release --target aarch64-unknown-linux-gnu - name: Build coderc (embed-astgrep) env: ASTGREP_RELEASE_BIN: ${{ github.workspace }}/lib/astgrep/target/aarch64-unknown-linux-gnu/release/astgrep CARGO_BUILD_EMBED_REQUIRED: "1" - ZIG_GLOBAL_CACHE_DIR: ${{ runner.temp }}/zig-cache + ZIG_LOCAL_CACHE_DIR: ${{ runner.temp }}/zig-cache run: cargo zigbuild -p cr-cli --release --target aarch64-unknown-linux-gnu --features cr-audit-static/embed-astgrep - run: | sudo apt-get install -y binutils-aarch64-linux-gnu