|
5 | 5 | types: [opened, synchronize, reopened]
|
6 | 6 |
|
7 | 7 | jobs:
|
| 8 | + build-win_x64: |
| 9 | + name: Build chiaki-ng win_x64 (VC) |
| 10 | + runs-on: windows-latest |
| 11 | + env: |
| 12 | + CC: clang-cl.exe |
| 13 | + CXX: clang-cl.exe |
| 14 | + VULKAN_SDK: C:\VulkanSDK\ |
| 15 | + triplet: x64-windows |
| 16 | + vcpkg_baseline: 42bb0d9e8d4cf33485afb9ee2229150f79f61a1f |
| 17 | + dep_folder: deps |
| 18 | + libplacebo_tag: v7.349.0 |
| 19 | + sdl2_compat_tag: 2.32.56 |
| 20 | + |
| 21 | + defaults: |
| 22 | + run: |
| 23 | + shell: powershell |
| 24 | + |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v4 |
| 27 | + with: |
| 28 | + submodules: 'recursive' |
| 29 | + |
| 30 | + - name: Set vcpkg installed dir |
| 31 | + run: | |
| 32 | + echo "VCPKG_INSTALLED_DIR=${{ github.workspace }}\build\vcpkg_installed" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append |
| 33 | +
|
| 34 | + - name: Setup Vulkan |
| 35 | + run: | |
| 36 | + $ProgressPreference = 'SilentlyContinue' |
| 37 | + $ver = (Invoke-WebRequest -Uri "https://vulkan.lunarg.com/sdk/latest.json" | ConvertFrom-Json).windows |
| 38 | + echo Version $ver |
| 39 | + Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/$ver/windows/vulkansdk-windows-X64-$ver.exe" -OutFile VulkanSDK.exe |
| 40 | + echo Downloaded |
| 41 | + .\VulkanSDK.exe --root ${{ env.VULKAN_SDK }} --accept-licenses --default-answer --confirm-command install |
| 42 | +
|
| 43 | + - name: Set up Ninja |
| 44 | + run: choco install ninja |
| 45 | + |
| 46 | + - name: Set up Clang |
| 47 | + uses: egor-tensin/setup-clang@v1 |
| 48 | + with: |
| 49 | + version: 18 |
| 50 | + |
| 51 | + - name: Setup MSVC |
| 52 | + uses: ilammy/msvc-dev-cmd@v1 |
| 53 | + |
| 54 | + - name: Setup Qt |
| 55 | + uses: jurplel/install-qt-action@v4 |
| 56 | + with: |
| 57 | + version: "6.8.*" |
| 58 | + host: 'windows' |
| 59 | + target: 'desktop' |
| 60 | + modules: 'qtwebengine qtpositioning qtwebchannel qtwebsockets qtserialport' |
| 61 | + |
| 62 | + - name: Install pip dependencies |
| 63 | + run: | |
| 64 | + ${{ env.pythonLocation }}\python.exe -m pip install --upgrade pip |
| 65 | + ${{ env.pythonLocation }}\python.exe -m pip install --upgrade setuptools wheel |
| 66 | + ${{ env.pythonLocation }}\python.exe -m pip install --user --upgrade scons protobuf grpcio-tools pyinstaller |
| 67 | + ${{ env.pythonLocation }}\python.exe -m pip install --user --upgrade meson |
| 68 | + ${{ env.pythonLocation }}\python.exe -c 'import google.protobuf; print(google.protobuf.__file__)' |
| 69 | +
|
| 70 | + - name: Setup ffmpeg |
| 71 | + run: | |
| 72 | + $ProgressPreference = 'SilentlyContinue' |
| 73 | + Invoke-WebRequest -UseBasicParsing -Uri "https://github.com/streetpea/FFmpeg-Builds/releases/download/latest/ffmpeg-n7.1-latest-win64-gpl-shared-7.1.zip" -OutFile ".\ffmpeg-n7.1-latest-win64-gpl-shared-7.1.zip" |
| 74 | + Expand-Archive -LiteralPath "ffmpeg-n7.1-latest-win64-gpl-shared-7.1.zip" -DestinationPath "." |
| 75 | + Rename-Item "ffmpeg-n7.1-latest-win64-gpl-shared-7.1" "${{ env.dep_folder }}" |
| 76 | +
|
| 77 | + - name: Setup sdl2-compat |
| 78 | + run: | |
| 79 | + $ProgressPreference = 'SilentlyContinue' |
| 80 | + Invoke-WebRequest -UseBasicParsing -Uri https://github.com/libsdl-org/sdl2-compat/releases/download/release-${{ env.sdl2_compat_tag }}/sdl2-compat-${{ env.sdl2_compat_tag }}-win32-x64.zip -OutFile sdl2-compat-${{ env.sdl2_compat_tag }}-win32-x64.zip |
| 81 | + Expand-Archive -LiteralPath "sdl2-compat-${{ env.sdl2_compat_tag }}-win32-x64.zip" -DestinationPath ".\sdl2-compat-${{ env.sdl2_compat_tag }}-win32-x64" |
| 82 | + Get-ChildItem -Path ".\sdl2-compat-${{ env.sdl2_compat_tag }}-win32-x64\*" -Include "*.dll" | Copy-Item -Destination "${{ env.dep_folder }}\bin" |
| 83 | +
|
| 84 | + - name: Build SPIRV-Cross |
| 85 | + run: | |
| 86 | + git clone https://github.com/KhronosGroup/SPIRV-Cross.git |
| 87 | + cd SPIRV-Cross |
| 88 | + cmake ` |
| 89 | + -DCMAKE_BUILD_TYPE=Release ` |
| 90 | + -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}\${{ env.dep_folder }}" ` |
| 91 | + -DSPIRV_CROSS_SHARED=ON ` |
| 92 | + -S . ` |
| 93 | + -B build ` |
| 94 | + -G Ninja |
| 95 | + cmake --build build --config Release |
| 96 | + cmake --install build |
| 97 | +
|
| 98 | + - name: Setup shaderc |
| 99 | + run: | |
| 100 | + $ProgressPreference = 'SilentlyContinue' |
| 101 | + $url = ((Invoke-WebRequest -UseBasicParsing -Uri "https://storage.googleapis.com/shaderc/badges/build_link_windows_vs2019_release.html").Content | Select-String -Pattern 'url=(.*)"').Matches.Groups[1].Value |
| 102 | + Invoke-WebRequest -UseBasicParsing -Uri $url -OutFile .\shaderc.zip |
| 103 | + Expand-Archive -LiteralPath "shaderc.zip" -DestinationPath "." |
| 104 | + cp "./install/*" "./${{ env.dep_folder }}" -Force -Recurse |
| 105 | + rm "./install" -r -force |
| 106 | +
|
| 107 | + - name: Make build directory |
| 108 | + run: | |
| 109 | + mkdir build |
| 110 | +
|
| 111 | + - name: Setup vcpkg |
| 112 | + uses: lukka/run-vcpkg@v11 |
| 113 | + with: |
| 114 | + vcpkgGitCommitId: ${{ env.vcpkg_baseline }} |
| 115 | + runVcpkgInstall: true |
| 116 | + vcpkgJsonGlob: "vcpkg.json" |
| 117 | + |
| 118 | + - name: Build libplacebo |
| 119 | + run: | |
| 120 | + git clone --recursive https://github.com/haasn/libplacebo.git |
| 121 | + cd libplacebo |
| 122 | + git checkout --recurse-submodules ${{ env.libplacebo_tag }} |
| 123 | + meson setup ` |
| 124 | + --prefix "${{ github.workspace }}\${{ env.dep_folder }}" ` |
| 125 | + --native-file ../meson.ini ` |
| 126 | + "--pkg-config-path=['${env:VCPKG_INSTALLED_DIR}\${{ env.triplet }}\lib\pkgconfig','${env:VCPKG_INSTALLED_DIR}\${{ env.triplet }}\share\pkgconfig','${{ github.workspace }}\${{ env.dep_folder }}\lib\pkgconfig']" ` |
| 127 | + "--cmake-prefix-path=['${env:VCPKG_INSTALLED_DIR}\${{ env.triplet }}', '${{ env.VULKAN_SDK }}', '${{ github.workspace }}\${{ env.dep_folder }}']" ` |
| 128 | + -Dc_args="/I ${{ env.VULKAN_SDK }}Include" ` |
| 129 | + -Dcpp_args="/I ${{ env.VULKAN_SDK }}Include" ` |
| 130 | + -Dc_link_args="/LIBPATH:${{ env.VULKAN_SDK }}Lib" ` |
| 131 | + -Dcpp_link_args="/LIBPATH:${{ env.VULKAN_SDK }}Lib" ` |
| 132 | + -Ddemos=false ` |
| 133 | + ./build |
| 134 | + ninja -C./build |
| 135 | + ninja -C./build install |
| 136 | +
|
| 137 | + - name: Apply Patches |
| 138 | + run: | |
| 139 | + git apply --ignore-whitespace --verbose --directory=third-party/gf-complete/ scripts/windows-vc/gf-complete.patch |
| 140 | +
|
| 141 | + - name: Configure chiaki-ng |
| 142 | + run: | |
| 143 | + cmake ` |
| 144 | + -S . ` |
| 145 | + -B build ` |
| 146 | + -G Ninja ` |
| 147 | + -DCMAKE_TOOLCHAIN_FILE:STRING="vcpkg/scripts/buildsystems/vcpkg.cmake" ` |
| 148 | + -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE ` |
| 149 | + -DCMAKE_BUILD_TYPE=Release ` |
| 150 | + -DCHIAKI_ENABLE_CLI=OFF ` |
| 151 | + -DCHIAKI_GUI_ENABLE_SDL_GAMECONTROLLER=ON ` |
| 152 | + -DCHIAKI_ENABLE_STEAMDECK_NATIVE=OFF ` |
| 153 | + -DPYTHON_EXECUTABLE="${{ env.pythonLocation }}\python.exe" ` |
| 154 | + -DCMAKE_PREFIX_PATH="${{ github.workspace }}\${{ env.dep_folder }};${{ env.VULKAN_SDK }}" |
| 155 | +
|
| 156 | + - name: Build chiaki-ng |
| 157 | + run: | |
| 158 | + cmake --build build --config Release --clean-first --target chiaki |
| 159 | +
|
| 160 | + - name: Prepare Qt deployment package |
| 161 | + run: | |
| 162 | + mkdir chiaki-ng-Win |
| 163 | + cp build\gui\chiaki.exe chiaki-ng-Win |
| 164 | + cp build\third-party\cpp-steam-tools\cpp-steam-tools.dll chiaki-ng-Win |
| 165 | + cp scripts\qtwebengine_import.qml gui\src\qml\ |
| 166 | + cp "${env:VCPKG_INSTALLED_DIR}\${{ env.triplet }}\bin\libcrypto-*-x64.dll" chiaki-ng-Win |
| 167 | + cp "${env:VCPKG_INSTALLED_DIR}\${{ env.triplet }}\bin\libssl-*-x64.dll" chiaki-ng-Win |
| 168 | + cp "${env:VCPKG_INSTALLED_DIR}\${{ env.triplet }}\bin\hidapi.dll" chiaki-ng-Win |
| 169 | + cp "${env:VCPKG_INSTALLED_DIR}\${{ env.triplet }}\bin\fftw3.dll" chiaki-ng-Win |
| 170 | + cp "${env:VCPKG_INSTALLED_DIR}\${{ env.triplet }}\bin\opus.dll" chiaki-ng-Win |
| 171 | + cp "${env:VCPKG_INSTALLED_DIR}\${{ env.triplet }}\bin\libspeexdsp.dll" chiaki-ng-Win |
| 172 | + cp "${env:VCPKG_INSTALLED_DIR}\${{ env.triplet }}\bin\lcms2.dll" chiaki-ng-Win |
| 173 | + cp "${env:VCPKG_INSTALLED_DIR}\${{ env.triplet }}\bin\miniupnpc.dll" chiaki-ng-Win |
| 174 | + cp "${env:VCPKG_INSTALLED_DIR}\${{ env.triplet }}\bin\json-c.dll" chiaki-ng-Win |
| 175 | + cp "${{ github.workspace }}\${{ env.dep_folder }}\bin\swresample-*.dll" chiaki-ng-Win |
| 176 | + cp "${{ github.workspace }}\${{ env.dep_folder }}\bin\avcodec-*.dll" chiaki-ng-Win |
| 177 | + cp "${{ github.workspace }}\${{ env.dep_folder }}\bin\avutil-*.dll" chiaki-ng-Win |
| 178 | + cp "${{ github.workspace }}\${{ env.dep_folder }}\bin\avformat-*.dll" chiaki-ng-Win |
| 179 | + cp "${{ github.workspace }}\${{ env.dep_folder }}\bin\libplacebo-*.dll" chiaki-ng-Win |
| 180 | + cp "${{ github.workspace }}\${{ env.dep_folder }}\bin\shaderc_shared.dll" chiaki-ng-Win |
| 181 | + cp "${{ github.workspace }}\${{ env.dep_folder }}\bin\spirv-cross-c-shared.dll" chiaki-ng-Win |
| 182 | + cp "${{ github.workspace }}\${{ env.dep_folder }}\bin\SDL2.dll" chiaki-ng-Win |
| 183 | + cp "${{ github.workspace }}\${{ env.dep_folder }}\bin\SDL3.dll" chiaki-ng-Win |
| 184 | + windeployqt.exe --no-translations --qmldir=gui\src\qml --release chiaki-ng-Win\chiaki.exe |
| 185 | +
|
| 186 | + - name: Package chiaki-ng |
| 187 | + run: | |
| 188 | + $CHIAKI_VERSION_MAJOR = (Select-String -Path .\CMakeLists.txt -Pattern 'set\(CHIAKI_VERSION_MAJOR ([0-9]+)\)') | %{$_.Matches.Groups[1].value} |
| 189 | + $CHIAKI_VERSION_MINOR = (Select-String -Path .\CMakeLists.txt -Pattern 'set\(CHIAKI_VERSION_MINOR ([0-9]+)\)') | %{$_.Matches.Groups[1].value} |
| 190 | + $CHIAKI_VERSION_PATCH = (Select-String -Path .\CMakeLists.txt -Pattern 'set\(CHIAKI_VERSION_PATCH ([0-9]+)\)') | %{$_.Matches.Groups[1].value} |
| 191 | + $RELEASE_PACKAGE_FILE = "chiaki-ng-win_x64-VC-portable-$CHIAKI_VERSION_MAJOR.$CHIAKI_VERSION_MINOR.$CHIAKI_VERSION_PATCH-test-build-${{ github.sha }}.zip" |
| 192 | + Compress-Archive chiaki-ng-Win $RELEASE_PACKAGE_FILE |
| 193 | + $release_filepath = Get-ChildItem $RELEASE_PACKAGE_FILE | %{$_[0].FullName} |
| 194 | + echo "RELEASE_PACKAGE_PATH=$release_filepath" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append |
| 195 | +
|
| 196 | + - name: Upload chiaki-ng Artifact |
| 197 | + uses: actions/upload-artifact@v4 |
| 198 | + with: |
| 199 | + name: chiaki-ng-win_x64-VC-Release |
| 200 | + path: ${{ env.RELEASE_PACKAGE_PATH }} |
| 201 | + if-no-files-found: error |
| 202 | + retention-days: 7 |
| 203 | + |
| 204 | + - name: Compile .ISS to .EXE Installer |
| 205 | + uses: Minionguyjpro/Inno-Setup-Action@v1.2.2 |
| 206 | + with: |
| 207 | + path: "scripts/chiaki-ng.iss" |
| 208 | + options: /O+ |
| 209 | + |
| 210 | + - name: Upload chiaki-ng Artifact |
| 211 | + uses: actions/upload-artifact@v4 |
| 212 | + with: |
| 213 | + name: chiaki-ng-win_x64-VC-installer.zip |
| 214 | + path: chiaki-ng-windows-installer.exe |
| 215 | + if-no-files-found: error |
| 216 | + retention-days: 7 |
| 217 | + |
8 | 218 | build-windows_x64-msys2:
|
9 | 219 | name: Build windows msys2 version
|
10 | 220 | runs-on: windows-latest
|
|
0 commit comments