diff --git a/.github/workflows/build_releases.yml b/.github/workflows/build_releases.yml index 101f6c52..5bbb18e9 100644 --- a/.github/workflows/build_releases.yml +++ b/.github/workflows/build_releases.yml @@ -151,12 +151,17 @@ jobs: cross: true, } - # Windows ARM, may promote to official. + # Windows ARM; may promote to official. - { target: "aarch64-pc-windows-msvc", os: "windows-11-arm", cross: false, } + - { + target: "aarch64-pc-windows-gnullvm", + os: "windows-11-arm", + cross: false, + } # FreeBSD - { @@ -175,6 +180,11 @@ jobs: fetch-depth: 1 persist-credentials: false + - name: Install Windows ARM64 GNU toolchain + if: matrix.info.target == 'aarch64-pc-windows-gnullvm' + shell: pwsh + run: ./scripts/ci/setup_windows_gnullvm.ps1 + # TODO: Make this and the toolchain step a separate wrapper action? - name: Read Rust version shell: bash @@ -342,6 +352,11 @@ jobs: target: "aarch64-pc-windows-msvc", output: "bottom_aarch64_installer.msi", } + - { + os: "windows-11-arm", + target: "aarch64-pc-windows-gnullvm", + output: "bottom_aarch64_gnullvm_installer.msi", + } runs-on: ${{ matrix.info.os }} steps: - name: Checkout repository @@ -350,6 +365,11 @@ jobs: fetch-depth: 1 persist-credentials: false + - name: Install Windows ARM64 GNU toolchain + if: matrix.info.target == 'aarch64-pc-windows-gnullvm' + shell: pwsh + run: ./scripts/ci/setup_windows_gnullvm.ps1 + - name: Install Net-Framework-Core shell: powershell run: | @@ -386,7 +406,7 @@ jobs: env: BTM_GENERATE: true run: | - cargo wix --toolset modern --nocapture + cargo wix --toolset modern --target ${{ matrix.info.target }} --nocapture mv bottom_installer.msi ${{ matrix.info.output }} - name: Generate artifact attestation for file diff --git a/scripts/ci/setup_windows_gnullvm.ps1 b/scripts/ci/setup_windows_gnullvm.ps1 new file mode 100644 index 00000000..29096d11 --- /dev/null +++ b/scripts/ci/setup_windows_gnullvm.ps1 @@ -0,0 +1,21 @@ +$ErrorActionPreference = 'Stop' + +$msys2 = 'C:\msys64' +$package = 'mingw-w64-clang-aarch64-clang=23.1.4-1' +& "$msys2\usr\bin\bash.exe" -lc 'pacman --noconfirm -Sy' +if ($LASTEXITCODE -ne 0) { + throw 'Failed to synchronize the MSYS2 package databases' +} +& "$msys2\usr\bin\bash.exe" -lc "pacman --noconfirm -S --needed '$package'" +if ($LASTEXITCODE -ne 0) { + throw 'Failed to install the CLANGARM64 toolchain' +} + +$bin = "$msys2\clangarm64\bin" +$compiler = "$bin\aarch64-w64-mingw32-clang.exe" +if (-not (Test-Path $compiler)) { + throw "The CLANGARM64 compiler was not found at $compiler" +} + +$bin >> $env:GITHUB_PATH +& $compiler --version