-
Notifications
You must be signed in to change notification settings - Fork 14
build-and-deploy: add support for arm64 builds #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ on: | |
description: 'The ref containing the package definition' | ||
required: true | ||
architecture: | ||
description: 'The architecture to build for (only for MSYS packages)' | ||
description: 'The architecture to build for (only for MSYS packages and all arm64 builds)' | ||
required: false | ||
actor: | ||
description: The GitHub user on whose behalf this workflow is run | ||
|
@@ -37,7 +37,7 @@ env: | |
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
runs-on: ${{ github.event.inputs.architecture == 'aarch64' && fromJSON('["Windows", "ARM64"]') || 'windows-latest' }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
|
@@ -135,6 +135,8 @@ jobs: | |
flavor: ${{ env.PACKAGE_TO_BUILD == 'mingw-w64-git' && 'build-installers' || 'full' }} | ||
architecture: ${{ env.ARCHITECTURE || 'x86_64' }} | ||
msys: ${{ env.REPO == 'MSYS2-packages' || env.PACKAGE_TO_BUILD == 'git-for-windows-keyring' }} | ||
# We only have to clean up on self-hosted runners | ||
cleanup: ${{ runner.arch == 'ARM64' && true || false }} | ||
|
||
- name: Clone ${{ env.REPO }} | ||
shell: bash | ||
|
@@ -209,8 +211,10 @@ jobs: | |
printf '#!/bin/sh\n\nexec /mingw64/bin/git.exe "$@"\n' >/usr/bin/git | ||
} && | ||
MINGW_ARCHS_TO_BUILD=$(test "$ARCHITECTURE" == "aarch64" && echo "clangarm64" || echo "mingw32 mingw64") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dennisameling I hope you don't mind that I edited this: We can either use a Bash-style ternary (with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Works for me! 👍🏼 |
||
cd "/usr/src/$REPO/$PACKAGE_TO_BUILD" && | ||
MAKEFLAGS=-j6 PKGEXT='.pkg.tar.xz' MINGW_ARCH="mingw32 mingw64" $MAKEPKG -s --noconfirm && | ||
MAKEFLAGS=-j6 PKGEXT='.pkg.tar.xz' MINGW_ARCH=$MINGW_ARCHS_TO_BUILD $MAKEPKG -s --noconfirm && | ||
cp *.pkg.tar* "$dir/" && | ||
MAKEFLAGS=-j6 SRCEXT='.src.tar.gz' MINGW_ARCH=mingw64 $MAKEPKG --allsource && | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't use
env.ARCHITECTURE
here so had to resort togithub.event.inputs.architecture
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, the environment requires the runner to already run, and that requires
runs-on
to be specified ;-)