From a6fd34f589e43f403aa921f3296e6fa154bf7ba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orhun=20Parmaks=C4=B1z?= Date: Sun, 10 Dec 2023 16:13:34 +0100 Subject: [PATCH] Build ARM binaries for Linux (#151) --- .github/workflows/build-for-release.yml | 30 +++++++++++++++++++------ 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-for-release.yml b/.github/workflows/build-for-release.yml index fd92a52..a262359 100644 --- a/.github/workflows/build-for-release.yml +++ b/.github/workflows/build-for-release.yml @@ -9,37 +9,53 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + build_name: + [linux-x64-musl, linux-arm64-musl, macos-arm64, windows-x64-msvc] include: - - os: ubuntu-latest + - build_name: linux-x64-musl + os: ubuntu-latest exe_suffix: "" name_suffix: "" target: x86_64-unknown-linux-musl - - os: macos-latest + - build_name: linux-arm64-musl + os: ubuntu-latest + exe_suffix: "" + name_suffix: "" + target: aarch64-unknown-linux-musl + - build_name: macos-arm64 + os: macos-latest exe_suffix: "" name_suffix: ".arm" target: aarch64-apple-darwin - - os: windows-latest + - build_name: windows-x64-msvc + os: windows-latest exe_suffix: ".exe" name_suffix: ".exe" target: x86_64-pc-windows-msvc steps: - uses: actions/checkout@v3 - - name: Update rust + - name: Update Rust run: rustup update - name: Add target run: rustup target add ${{ matrix.target }} - name: Cache dependencies uses: Swatinem/rust-cache@v2 - name: Build - run: "cargo build --release --locked --verbose --target ${{ matrix.target }}" + shell: bash + run: | + _cargo="cargo" + if [ "${{ matrix.build_name }}" = "linux-arm64-musl" ]; then + cargo install cross + _cargo="cross" + fi + $_cargo build --release --locked --verbose --target ${{ matrix.target }} - name: Upload asset uses: actions/upload-release-asset@v1.0.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: asset_path: target/${{ matrix.target }}/release/dotter${{ matrix.exe_suffix }} - asset_name: dotter${{ matrix.name_suffix }} + asset_name: dotter-${{ matrix.build_name}}${{ matrix.name_suffix }} asset_content_type: application/octet-stream upload_url: ${{ github.event.release.upload_url }} build-completions: