diff --git a/.github/workflows/build-rust-cross-platform.yml b/.github/workflows/build-rust-cross-platform.yml index 46b481a65..a6c203818 100644 --- a/.github/workflows/build-rust-cross-platform.yml +++ b/.github/workflows/build-rust-cross-platform.yml @@ -24,8 +24,14 @@ jobs: target: aarch64-apple-darwin - os: windows-2022 target: x86_64-pc-windows-msvc + - os: windows-2022 + target: x86_64-pc-windows-gnu - os: ubuntu-22.04 target: x86_64-unknown-linux-gnu + - os: ubuntu-22.04 + target: x86_64-unknown-linux-musl + - os: ubuntu-22.04 + target: aarch64-unknown-linux-musl steps: - name: Checkout @@ -39,13 +45,29 @@ jobs: - name: Cache cargo registry uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + - uses: goto-bus-stop/setup-zig@7ab2955eb728f5440978d5824358023be3a2802d # v2.2.0 + if: ${{ contains(matrix.settings.target, 'musl') }} + with: + version: 0.12.0 + + - name: Install Zigbuild + if: ${{ contains(matrix.settings.target, 'musl') }} + run: cargo install cargo-zigbuild --locked --git https://github.com/rust-cross/cargo-zigbuild --rev 6f7e1336c9cd13cf1b3704f93c40fcf84caaed6b # 0.18.4 + - name: Add build architecture run: rustup target add ${{ matrix.settings.target }} - - name: Build Rust + - name: Build Rust for - ${{ matrix.settings.target }} + if: ${{ contains(matrix.settings.target, 'musl') }} + env: + RUSTFLAGS: "-D warnings" + run: cargo zigbuild -p bitwarden-c --target ${{ matrix.settings.target }} --release + + - name: Build Rust for - ${{ matrix.settings.target }} + if: ${{ !contains(matrix.settings.target, 'musl') }} env: RUSTFLAGS: "-D warnings" - run: cargo build --target ${{ matrix.settings.target }} --release + run: cargo build -p bitwarden-c --target ${{ matrix.settings.target }} --release - name: Upload Artifact uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3