diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d7d64e..8e3724e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,41 +45,67 @@ jobs: path: dist/* build-windows: - runs-on: ubuntu-24.04 + runs-on: ${{ matrix.runner }} + strategy: + matrix: + include: + - target: x86_64-pc-windows-gnu + arch: x86_64 + runner: ubuntu-24.04 + - target: i686-pc-windows-gnu + arch: x86 + runner: ubuntu-24.04 + - target: aarch64-pc-windows-msvc + arch: arm64 + runner: windows-11-arm steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: - targets: x86_64-pc-windows-gnu + targets: ${{ matrix.target }} - - name: Install mingw-w64 + - name: Install mingw-w64 (x86_64/x86) + if: matrix.arch == 'x86_64' || matrix.arch == 'x86' run: | sudo apt-get update sudo apt-get install -y mingw-w64 - - name: Build binaries (cross-compile) + - name: Build binaries (Linux cross-compile) + if: matrix.arch != 'arm64' run: | - cargo build --bins --workspace --release --target x86_64-pc-windows-gnu + cargo build --bins --workspace --release --target ${{ matrix.target }} mkdir -p dist - cp target/x86_64-pc-windows-gnu/release/plumeimpactor.exe dist/Impactor-windows-x86_64-portable.exe - cp target/x86_64-pc-windows-gnu/release/plumesign.exe dist/plumesign-windows-x86_64.exe + cp target/${{ matrix.target }}/release/plumeimpactor.exe dist/Impactor-windows-${{ matrix.arch }}-portable.exe + cp target/${{ matrix.target }}/release/plumesign.exe dist/plumesign-windows-${{ matrix.arch }}.exe + + - name: Build binaries (Windows ARM64 native) + if: matrix.arch == 'arm64' + shell: pwsh + run: | + cargo build --bins --workspace --release --target ${{ matrix.target }} + New-Item -ItemType Directory -Force -Path dist + Copy-Item "target/${{ matrix.target }}/release/plumeimpactor.exe" "dist/Impactor-windows-${{ matrix.arch }}-portable.exe" + Copy-Item "target/${{ matrix.target }}/release/plumesign.exe" "dist/plumesign-windows-${{ matrix.arch }}.exe" - name: Upload Bundles uses: actions/upload-artifact@v4 with: - name: ${{ env.BINARY_NAME }}-windows + name: ${{ env.BINARY_NAME }}-windows-${{ matrix.arch }} path: dist/*.exe build-windows-installer: runs-on: windows-latest needs: [build-windows] + strategy: + matrix: + arch: [x86_64, x86, arm64] steps: - uses: actions/checkout@v4 - name: Download Windows Artifacts uses: actions/download-artifact@v4 with: - name: ${{ env.BINARY_NAME }}-windows + name: ${{ env.BINARY_NAME }}-windows-${{ matrix.arch }} path: dist - name: Install NSIS @@ -89,15 +115,15 @@ jobs: run: | mkdir dist\nsis copy package\windows\* dist\nsis\ - copy dist\Impactor-windows-x86_64-portable.exe dist\nsis\plumeimpactor.exe + copy dist\Impactor-windows-${{ matrix.arch }}-portable.exe dist\nsis\plumeimpactor.exe makensis dist\nsis\installer.nsi - move dist\nsis\installer.exe dist\Impactor-windows-x86_64-setup.exe + move dist\nsis\installer.exe dist\Impactor-windows-${{ matrix.arch }}-setup.exe - name: Upload Installer uses: actions/upload-artifact@v4 with: - name: ${{ env.BINARY_NAME }}-windows-installer - path: dist/Impactor-windows-x86_64-setup.exe + name: ${{ env.BINARY_NAME }}-windows-installer-${{ matrix.arch }} + path: dist/Impactor-windows-${{ matrix.arch }}-setup.exe build-macos-slices: runs-on: ubuntu-24.04