Skip to content

Commit 119a90a

Browse files
dennisamelingdscho
authored andcommitted
build-and-deploy: add support for arm64 builds
Note that this only works for self-hosted runners. GitHub Actions will pick up and use the first available arm64 runner. Signed-off-by: Dennis Ameling <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 65bd4ae commit 119a90a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/build-and-deploy.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
description: 'The ref containing the package definition'
1818
required: true
1919
architecture:
20-
description: 'The architecture to build for (only for MSYS packages)'
20+
description: 'The architecture to build for (only for MSYS packages and all arm64 builds)'
2121
required: false
2222
actor:
2323
description: The GitHub user on whose behalf this workflow is run
@@ -37,7 +37,7 @@ env:
3737

3838
jobs:
3939
build:
40-
runs-on: windows-latest
40+
runs-on: ${{ github.event.inputs.architecture == 'aarch64' && fromJSON('["Windows", "ARM64"]') || 'windows-latest' }}
4141
steps:
4242
- uses: actions/checkout@v3
4343

@@ -135,6 +135,8 @@ jobs:
135135
flavor: ${{ env.PACKAGE_TO_BUILD == 'mingw-w64-git' && 'build-installers' || 'full' }}
136136
architecture: ${{ env.ARCHITECTURE || 'x86_64' }}
137137
msys: ${{ env.REPO == 'MSYS2-packages' || env.PACKAGE_TO_BUILD == 'git-for-windows-keyring' }}
138+
# We only have to clean up on self-hosted runners
139+
cleanup: ${{ runner.arch == 'ARM64' && true || false }}
138140

139141
- name: Clone ${{ env.REPO }}
140142
shell: bash
@@ -209,8 +211,10 @@ jobs:
209211
printf '#!/bin/sh\n\nexec /mingw64/bin/git.exe "$@"\n' >/usr/bin/git
210212
} &&
211213
214+
MINGW_ARCHS_TO_BUILD=$(test "$ARCHITECTURE" == "aarch64" && echo "clangarm64" || echo "mingw32 mingw64")
215+
212216
cd "/usr/src/$REPO/$PACKAGE_TO_BUILD" &&
213-
MAKEFLAGS=-j6 PKGEXT='.pkg.tar.xz' MINGW_ARCH="mingw32 mingw64" $MAKEPKG -s --noconfirm &&
217+
MAKEFLAGS=-j6 PKGEXT='.pkg.tar.xz' MINGW_ARCH=$MINGW_ARCHS_TO_BUILD $MAKEPKG -s --noconfirm &&
214218
cp *.pkg.tar* "$dir/" &&
215219
216220
MAKEFLAGS=-j6 SRCEXT='.src.tar.gz' MINGW_ARCH=mingw64 $MAKEPKG --allsource &&

0 commit comments

Comments
 (0)