@@ -740,9 +740,26 @@ jobs:
740
740
validate : false
741
741
742
742
build_win :
743
- name : Windows
743
+ name : ${{ matrix.name }}
744
744
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
746
763
steps :
747
764
- name : Checkout
748
765
uses : actions/checkout@v4
@@ -752,6 +769,7 @@ jobs:
752
769
- name : Prepare tests
753
770
id : prepare-tests
754
771
if : false # todo: DirectX11 is not available, so even software encoder fails
772
+ shell : pwsh
755
773
run : |
756
774
# function to download and extract a zip file
757
775
function DownloadAndExtract {
@@ -854,63 +872,80 @@ jobs:
854
872
Get-Content -Path monitor_list.txt
855
873
856
874
- name : Setup Dependencies Windows
857
- # if a dependency needs to be pinned, see https://github.com/LizardByte/build-deps/pull/186
858
875
uses : msys2/setup-msys2@v2
859
876
with :
860
- msystem : ucrt64
877
+ msystem : ${{ matrix.msystem }}
861
878
update : true
862
- install : >-
863
- wget
864
879
865
880
- name : Update Windows dependencies
866
881
env :
867
- gcc_version : " 14.2.0-3 "
868
- shell : msys2 {0 }
882
+ MSYSTEM : ${{ matrix.msystem }}
883
+ TOOLCHAIN : ${{ matrix.toolchain } }
869
884
run : |
870
- broken_deps=(
871
- "mingw-w64-ucrt-x86_64-gcc"
872
- "mingw-w64-ucrt-x86_64-gcc-libs"
885
+ # variables
886
+ declare -A pinned_deps
887
+ if [[ ${MSYSTEM} == "ucrt64" ]]; then
888
+ pinned_deps["mingw-w64-${TOOLCHAIN}-gcc"]="14.2.0-3"
889
+ pinned_deps["mingw-w64-${TOOLCHAIN}-gcc-libs"]="14.2.0-3"
890
+ fi
891
+
892
+ dependencies=(
893
+ "git"
894
+ "mingw-w64-${TOOLCHAIN}-cmake"
895
+ "mingw-w64-${TOOLCHAIN}-cppwinrt"
896
+ "mingw-w64-${TOOLCHAIN}-curl-winssl"
897
+ "mingw-w64-${TOOLCHAIN}-graphviz"
898
+ "mingw-w64-${TOOLCHAIN}-miniupnpc"
899
+ "mingw-w64-${TOOLCHAIN}-nlohmann-json"
900
+ "mingw-w64-${TOOLCHAIN}-nodejs"
901
+ "mingw-w64-${TOOLCHAIN}-onevpl"
902
+ "mingw-w64-${TOOLCHAIN}-openssl"
903
+ "mingw-w64-${TOOLCHAIN}-opus"
904
+ "mingw-w64-${TOOLCHAIN}-toolchain"
873
905
)
874
906
907
+ if [[ ${MSYSTEM} == "ucrt64" ]]; then
908
+ dependencies+=(
909
+ "mingw-w64-${TOOLCHAIN}-MinHook"
910
+ "mingw-w64-${TOOLCHAIN}-nsis" # TODO: how to create an arm64 installer?
911
+ )
912
+ fi
913
+
914
+ # do not modify below this line
915
+
916
+ ignore_packages=()
875
917
tarballs=""
876
- for dep in "${broken_deps[@]}"; do
877
- tarball="${dep}-${gcc_version}-any.pkg.tar.zst"
918
+ for pkg in "${!pinned_deps[@]}"; do
919
+ ignore_packages+=("${pkg}")
920
+ version="${pinned_deps[$pkg]}"
921
+ tarball="${pkg}-${version}-any.pkg.tar.zst"
878
922
879
923
# download and install working version
880
- wget https://repo.msys2.org/mingw/ucrt64 /${tarball}
924
+ wget " https://repo.msys2.org/mingw/${MSYSTEM} /${tarball}"
881
925
882
926
tarballs="${tarballs} ${tarball}"
883
927
done
884
928
885
- # install broken dependencies
929
+ # Create the ignore string for pacman
930
+ ignore_list=$(IFS=,; echo "${ignore_packages[*]}")
931
+
932
+ # install pinned dependencies
886
933
if [ -n "$tarballs" ]; then
887
934
pacman -U --noconfirm ${tarballs}
888
935
fi
889
936
890
- # install dependencies
891
- dependencies=(
892
- "git"
893
- "mingw-w64-ucrt-x86_64-cmake"
894
- "mingw-w64-ucrt-x86_64-cppwinrt"
895
- "mingw-w64-ucrt-x86_64-curl-winssl"
896
- "mingw-w64-ucrt-x86_64-graphviz"
897
- "mingw-w64-ucrt-x86_64-MinHook"
898
- "mingw-w64-ucrt-x86_64-miniupnpc"
899
- "mingw-w64-ucrt-x86_64-nlohmann-json"
900
- "mingw-w64-ucrt-x86_64-nodejs"
901
- "mingw-w64-ucrt-x86_64-nsis"
902
- "mingw-w64-ucrt-x86_64-onevpl"
903
- "mingw-w64-ucrt-x86_64-openssl"
904
- "mingw-w64-ucrt-x86_64-opus"
905
- "mingw-w64-ucrt-x86_64-toolchain"
906
- )
907
-
908
- pacman -Syu --noconfirm --ignore="$(IFS=,; echo "${broken_deps[*]}")" "${dependencies[@]}"
937
+ # Only add --ignore if we have packages to ignore
938
+ if [ -n "$ignore_list" ]; then
939
+ pacman -Syu --noconfirm --ignore="${ignore_list}" "${dependencies[@]}"
940
+ else
941
+ pacman -Syu --noconfirm "${dependencies[@]}"
942
+ fi
909
943
910
944
- name : Install Doxygen
911
945
# GCC compiled doxygen has issues when running graphviz
912
946
env :
913
947
DOXYGEN_VERSION : " 1.11.0"
948
+ shell : pwsh
914
949
run : |
915
950
# Set version variables
916
951
$doxy_ver = $env:DOXYGEN_VERSION
@@ -940,7 +975,6 @@ jobs:
940
975
941
976
- name : Python Path
942
977
id : python-path
943
- shell : msys2 {0}
944
978
run : |
945
979
# replace backslashes with double backslashes
946
980
python_path=$(echo "${{ steps.setup-python.outputs.python-path }}" | sed 's/\\/\\\\/g')
@@ -950,7 +984,6 @@ jobs:
950
984
echo "python-path=${python_path}" >> $GITHUB_OUTPUT
951
985
952
986
- name : Build Windows
953
- shell : msys2 {0}
954
987
env :
955
988
BRANCH : ${{ github.head_ref || github.ref_name }}
956
989
BUILD_VERSION : ${{ needs.setup_release.outputs.release_tag }}
@@ -962,40 +995,48 @@ jobs:
962
995
-B build \
963
996
-G Ninja \
964
997
-S . \
965
- -DBUILD_WERROR=ON \
966
998
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
967
999
-DSUNSHINE_ASSETS_DIR=assets \
968
1000
-DSUNSHINE_PUBLISHER_NAME='${{ github.repository_owner }}' \
969
1001
-DSUNSHINE_PUBLISHER_WEBSITE='https://app.lizardbyte.dev' \
970
1002
-DSUNSHINE_PUBLISHER_ISSUE_URL='https://app.lizardbyte.dev/support'
971
1003
ninja -C build
972
1004
973
- - name : Package Windows
974
- shell : msys2 {0}
1005
+ - name : Package Windows (Prepare)
975
1006
run : |
976
1007
mkdir -p artifacts
1008
+
1009
+ - name : Package Windows (Installer)
1010
+ if : runner.arch == 'X86' || runner.arch == 'X64'
1011
+ run : |
977
1012
cd build
978
1013
979
1014
# package
980
1015
cpack -G NSIS
1016
+
1017
+ # move
1018
+ mv ./cpack_artifacts/Sunshine.exe ../artifacts/Sunshine-${{ matrix.os }}-installer.exe
1019
+
1020
+ - name : Package Windows (Portable)
1021
+ run : |
1022
+ cd build
1023
+
1024
+ # package
981
1025
cpack -G ZIP
982
1026
983
1027
# move
984
- mv ./cpack_artifacts/Sunshine.exe ../artifacts/sunshine-windows-installer.exe
985
- mv ./cpack_artifacts/Sunshine.zip ../artifacts/sunshine-windows-portable.zip
1028
+ mv ./cpack_artifacts/Sunshine.zip ../artifacts/Sunshine-${{ matrix.os }}-portable.zip
986
1029
987
1030
- name : Run tests
988
1031
id : test
989
- shell : msys2 {0}
990
1032
working-directory : build/tests
991
1033
run : |
992
1034
./test_sunshine.exe --gtest_color=yes --gtest_output=xml:test_results.xml
993
1035
994
1036
- name : Generate gcov report
995
1037
id : test_report
996
1038
# any except canceled or skipped
997
- if : always() && (steps.test.outcome == 'success' || steps.test.outcome == 'failure')
998
- shell : msys2 {0}
1039
+ if : always() && (steps.test.outcome == 'success' || steps.test.outcome == 'failure') && runner.arch == 'X86' || runner.arch == 'X64'
999
1040
working-directory : build
1000
1041
run : |
1001
1042
${{ steps.python-path.outputs.python-path }} -m pip install gcovr
@@ -1018,7 +1059,7 @@ jobs:
1018
1059
disable_search : true
1019
1060
fail_ci_if_error : true
1020
1061
files : ./build/tests/test_results.xml
1021
- flags : ${{ runner.os }}
1062
+ flags : ${{ matrix.name }}
1022
1063
handle_no_reports_found : true
1023
1064
token : ${{ secrets.CODECOV_TOKEN }}
1024
1065
verbose : true
@@ -1034,11 +1075,12 @@ jobs:
1034
1075
disable_search : true
1035
1076
fail_ci_if_error : true
1036
1077
files : ./build/coverage.xml
1037
- flags : ${{ runner.os }}
1078
+ flags : ${{ matrix.name }}
1038
1079
token : ${{ secrets.CODECOV_TOKEN }}
1039
1080
verbose : true
1040
1081
1041
1082
- name : Package Windows Debug Info
1083
+ shell : pwsh
1042
1084
working-directory : build
1043
1085
run : |
1044
1086
# use .dbg file extension for binaries to avoid confusion with real packages
@@ -1049,12 +1091,12 @@ jobs:
1049
1091
7z -r `
1050
1092
"-xr!CMakeFiles" `
1051
1093
"-xr!cpack_artifacts" `
1052
- a "../artifacts/sunshine-win32 -debuginfo.7z" "*.dbg"
1094
+ a "../artifacts/${{ matrix.name }} -debuginfo.7z" "*.dbg"
1053
1095
1054
1096
- name : Upload Artifacts
1055
1097
uses : actions/upload-artifact@v4
1056
1098
with :
1057
- name : sunshine-windows
1099
+ name : Sunshine-${{ matrix.name }}
1058
1100
path : artifacts/
1059
1101
if-no-files-found : error
1060
1102
0 commit comments