|
79 | 79 | - name: Setup Rust |
80 | 80 | uses: dtolnay/rust-toolchain@stable |
81 | 81 |
|
| 82 | + - name: Install Zig |
| 83 | + if: startsWith(matrix.platform, 'ubuntu') |
| 84 | + shell: bash |
| 85 | + run: | |
| 86 | + wget -q https://ziglang.org/download/0.15.2/zig-x86_64-linux-0.15.2.tar.xz |
| 87 | + tar -xf zig-x86_64-linux-0.15.2.tar.xz |
| 88 | + sudo mv zig-x86_64-linux-0.15.2 /usr/local/zig |
| 89 | + echo "/usr/local/zig" >> $GITHUB_PATH |
| 90 | +
|
| 91 | + - name: Install zigbuild |
| 92 | + run: cargo install --locked cargo-zigbuild |
| 93 | + |
82 | 94 | - name: Rust cache |
83 | 95 | uses: Swatinem/rust-cache@v2 |
84 | 96 | with: |
|
92 | 104 | run: | |
93 | 105 | sudo apt-get update |
94 | 106 | sudo apt-get install -y \ |
95 | | - gcc-aarch64-linux-gnu \ |
96 | | - musl-tools \ |
97 | 107 | libwebkit2gtk-4.1-dev \ |
98 | 108 | libgtk-3-dev \ |
99 | 109 | libayatana-appindicator3-dev \ |
@@ -173,14 +183,11 @@ jobs: |
173 | 183 | echo "Building CLI for $target" |
174 | 184 | rustup target add "$target" |
175 | 185 |
|
176 | | - # Set linker for aarch64 cross-compilation |
177 | | - if [[ "$target" == "aarch64-unknown-linux-gnu" ]]; then |
178 | | - export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc |
179 | | - elif [[ "$target" == "aarch64-unknown-linux-musl" ]]; then |
180 | | - export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc |
| 186 | + if [[ "$target" == "aarch64-unknown-linux-gnu" || "$target" == "aarch64-unknown-linux-musl" || "$target" == "x86_64-unknown-linux-musl" ]]; then |
| 187 | + cargo zigbuild -p tidewave-cli --release --target $target |
| 188 | + else |
| 189 | + cargo build -p tidewave-cli --release --target $target |
181 | 190 | fi |
182 | | -
|
183 | | - cargo build -p tidewave-cli --release --target $target |
184 | 191 | done |
185 | 192 |
|
186 | 193 | - name: Sign CLI binaries (macos) |
|
0 commit comments