Skip to content

Commit 9d0c82c

Browse files
rbqvqReenigneArcher
andcommitted
ci(build/windows): add support for arm64
nsis does not support arm64, so we cannot create an installer at this time Signed-off-by: Coia Prant <[email protected]> Co-authored-by: ReenigneArcher <[email protected]>
1 parent e39a091 commit 9d0c82c

File tree

1 file changed

+51
-16
lines changed

1 file changed

+51
-16
lines changed

.github/workflows/CI.yml

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -740,9 +740,26 @@ jobs:
740740
validate: false
741741

742742
build_win:
743-
name: Windows
743+
name: ${{ matrix.name }}
744744
needs: setup_release
745-
runs-on: windows-2022
745+
runs-on: ${{ matrix.os }}
746+
defaults:
747+
run:
748+
shell: msys2 {0}
749+
strategy:
750+
fail-fast: false
751+
matrix:
752+
include:
753+
- name: Windows-AMD64
754+
os: windows-2022
755+
arch: x86_64
756+
msystem: ucrt64
757+
toolchain: ucrt-x86_64
758+
- name: Windows-ARM64
759+
os: windows-11-arm
760+
arch: aarch64
761+
msystem: clangarm64
762+
toolchain: clang-aarch64
746763
steps:
747764
- name: Checkout
748765
uses: actions/checkout@v4
@@ -857,15 +874,15 @@ jobs:
857874
# if a dependency needs to be pinned, see https://github.com/LizardByte/build-deps/pull/186
858875
uses: msys2/setup-msys2@v2
859876
with:
860-
msystem: ucrt64
877+
msystem: ${{ matrix.msystem }}
861878
update: true
862879
install: >-
863880
wget
864881
865882
- name: Update Windows dependencies
866883
env:
867-
MSYSTEM: "ucrt64"
868-
TOOLCHAIN: "ucrt-x86_64"
884+
MSYSTEM: ${{ matrix.msystem }}
885+
TOOLCHAIN: ${{ matrix.toolchain }}
869886
shell: msys2 {0}
870887
run: |
871888
# variables
@@ -879,17 +896,22 @@ jobs:
879896
"mingw-w64-${TOOLCHAIN}-curl-winssl"
880897
"mingw-w64-${TOOLCHAIN}-gcc"
881898
"mingw-w64-${TOOLCHAIN}-graphviz"
882-
"mingw-w64-${TOOLCHAIN}-MinHook"
883899
"mingw-w64-${TOOLCHAIN}-miniupnpc"
884900
"mingw-w64-${TOOLCHAIN}-nlohmann-json"
885901
"mingw-w64-${TOOLCHAIN}-nodejs"
886-
"mingw-w64-${TOOLCHAIN}-nsis"
887902
"mingw-w64-${TOOLCHAIN}-onevpl"
888903
"mingw-w64-${TOOLCHAIN}-openssl"
889904
"mingw-w64-${TOOLCHAIN}-opus"
890905
"mingw-w64-${TOOLCHAIN}-toolchain"
891906
)
892907
908+
if [[ ${MSYSTEM} == "ucrt64" ]]; then
909+
dependencies+=(
910+
"mingw-w64-${TOOLCHAIN}-MinHook"
911+
"mingw-w64-${TOOLCHAIN}-nsis" # TODO: how to create an arm64 installer?
912+
)
913+
fi
914+
893915
# do not modify below this line
894916
895917
ignore_packages=()
@@ -975,27 +997,40 @@ jobs:
975997
-B build \
976998
-G Ninja \
977999
-S . \
978-
-DBUILD_WERROR=ON \
9791000
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
9801001
-DSUNSHINE_ASSETS_DIR=assets \
9811002
-DSUNSHINE_PUBLISHER_NAME='${{ github.repository_owner }}' \
9821003
-DSUNSHINE_PUBLISHER_WEBSITE='https://app.lizardbyte.dev' \
9831004
-DSUNSHINE_PUBLISHER_ISSUE_URL='https://app.lizardbyte.dev/support'
9841005
ninja -C build
9851006
986-
- name: Package Windows
1007+
- name: Package Windows (Prepare)
9871008
shell: msys2 {0}
9881009
run: |
9891010
mkdir -p artifacts
1011+
1012+
- name: Package Windows (Installer)
1013+
if: runner.arch == 'X86' || runner.arch == 'X64'
1014+
shell: msys2 {0}
1015+
run: |
9901016
cd build
9911017
9921018
# package
9931019
cpack -G NSIS
1020+
1021+
# move
1022+
mv ./cpack_artifacts/Sunshine.exe ../artifacts/Sunshine-${{ matrix.os }}-installer.exe
1023+
1024+
- name: Package Windows (Portable)
1025+
shell: msys2 {0}
1026+
run: |
1027+
cd build
1028+
1029+
# package
9941030
cpack -G ZIP
9951031
9961032
# move
997-
mv ./cpack_artifacts/Sunshine.exe ../artifacts/sunshine-windows-installer.exe
998-
mv ./cpack_artifacts/Sunshine.zip ../artifacts/sunshine-windows-portable.zip
1033+
mv ./cpack_artifacts/Sunshine.zip ../artifacts/Sunshine-${{ matrix.os }}-portable.zip
9991034
10001035
- name: Run tests
10011036
id: test
@@ -1007,7 +1042,7 @@ jobs:
10071042
- name: Generate gcov report
10081043
id: test_report
10091044
# any except canceled or skipped
1010-
if: always() && (steps.test.outcome == 'success' || steps.test.outcome == 'failure')
1045+
if: always() && (steps.test.outcome == 'success' || steps.test.outcome == 'failure') && runner.arch == 'X86' || runner.arch == 'X64'
10111046
shell: msys2 {0}
10121047
working-directory: build
10131048
run: |
@@ -1031,7 +1066,7 @@ jobs:
10311066
disable_search: true
10321067
fail_ci_if_error: true
10331068
files: ./build/tests/test_results.xml
1034-
flags: ${{ runner.os }}
1069+
flags: ${{ matrix.name }}
10351070
handle_no_reports_found: true
10361071
token: ${{ secrets.CODECOV_TOKEN }}
10371072
verbose: true
@@ -1047,7 +1082,7 @@ jobs:
10471082
disable_search: true
10481083
fail_ci_if_error: true
10491084
files: ./build/coverage.xml
1050-
flags: ${{ runner.os }}
1085+
flags: ${{ matrix.name }}
10511086
token: ${{ secrets.CODECOV_TOKEN }}
10521087
verbose: true
10531088

@@ -1062,12 +1097,12 @@ jobs:
10621097
7z -r `
10631098
"-xr!CMakeFiles" `
10641099
"-xr!cpack_artifacts" `
1065-
a "../artifacts/sunshine-win32-debuginfo.7z" "*.dbg"
1100+
a "../artifacts/${{ matrix.name }}-debuginfo.7z" "*.dbg"
10661101
10671102
- name: Upload Artifacts
10681103
uses: actions/upload-artifact@v4
10691104
with:
1070-
name: sunshine-windows
1105+
name: Sunshine-${{ matrix.name }}
10711106
path: artifacts/
10721107
if-no-files-found: error
10731108

0 commit comments

Comments
 (0)