@@ -47,34 +47,30 @@ jobs:
47
47
sudo apt-get update
48
48
sudo apt-get install -y gcc-aarch64-linux-gnu
49
49
50
- - name : Install cross-compilation tools for aarch64-musl
51
- if : matrix.settings.target == 'aarch64-unknown-linux-musl'
52
- run : |
53
- sudo apt-get update
54
- sudo apt-get install -y musl-tools
55
- wget https://musl.cc/aarch64-linux-musl-cross.tgz
56
- tar -xzf aarch64-linux-musl-cross.tgz
57
- echo "$PWD/aarch64-linux-musl-cross/bin" >> $GITHUB_PATH
50
+ - uses : goto-bus-stop/setup-zig@7ab2955eb728f5440978d5824358023be3a2802d # v2.2.0
51
+ if : ${{ contains(matrix.settings.target, 'musl') }}
52
+ with :
53
+ version : 0.12.0
58
54
59
- - name : Install cross-compilation tools for x86_64-musl
60
- if : matrix.settings.target == 'x86_64-unknown-linux-musl'
61
- run : |
62
- sudo apt-get update
63
- sudo apt-get install -y musl-tools
55
+ - name : Install Zigbuild
56
+ if : ${{ contains(matrix.settings.target, 'musl') }}
57
+ run : cargo install cargo-zigbuild --locked --git https://github.com/rust-cross/cargo-zigbuild --rev 6f7e1336c9cd13cf1b3704f93c40fcf84caaed6b # 0.18.4
64
58
65
- - name : Build Rust (GNU/Others)
66
- if : ${{ !endsWith(matrix.settings.target, '-linux-musl') }}
59
+ - name : Add build architecture
60
+ run : rustup target add ${{ matrix.settings.target }}
61
+
62
+ - name : Build Rust for MUSL - ${{ matrix.settings.target }}
63
+ if : ${{ contains(matrix.settings.target, 'musl') }}
67
64
env :
68
- RUSTFLAGS : " -D warnings"
69
- CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER : aarch64-linux-gnu-gcc
70
- run : cargo build --target ${{ matrix.settings.target }} --release --workspace --exclude infisical-py
65
+ RUSTFLAGS : " -D warnings -C target-feature=-crt-static"
66
+ run : cargo zigbuild -p infisical-c --target ${{ matrix.settings.target }} --release
71
67
72
- - name : Build Rust (Musl)
73
- if : endsWith (matrix.settings.target, '-linux- musl')
68
+ - name : Build Rust for Non-MUSL - ${{ matrix.settings.target }}
69
+ if : ${{ !contains (matrix.settings.target, 'musl') }}
74
70
env :
71
+ CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER : aarch64-linux-gnu-gcc
75
72
RUSTFLAGS : " -D warnings -C target-feature=-crt-static"
76
- CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER : aarch64-linux-musl-gcc
77
- run : cargo build --target ${{ matrix.settings.target }} --release --workspace --exclude infisical-py
73
+ run : cargo build -p infisical-c --target ${{ matrix.settings.target }} --release
78
74
79
75
- name : Upload Artifact
80
76
uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
0 commit comments