Build chiaki-ng Windows x86_64 (VC) #46
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build chiaki-ng Windows x86_64 (VC) | |
on: | |
workflow_dispatch: | |
jobs: | |
build-win_x64: | |
name: Build chiaki-ng win_x64 (VC) | |
runs-on: windows-latest | |
env: | |
CC: clang-cl.exe | |
CXX: clang-cl.exe | |
VULKAN_SDK: C:\VulkanSDK\ | |
triplet: x64-windows | |
vcpkg_baseline: 42bb0d9e8d4cf33485afb9ee2229150f79f61a1f | |
dep_folder: deps | |
libplacebo_tag: 69653ceb2d029de937880662dcfa849eb85f0682 | |
defaults: | |
run: | |
shell: powershell | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Set vcpkg installed dir | |
run: | | |
echo "VCPKG_INSTALLED_DIR=${{ github.workspace }}\build\vcpkg_installed" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Setup Vulkan | |
run: | | |
$ProgressPreference = 'SilentlyContinue' | |
$ver = (Invoke-WebRequest -Uri "https://vulkan.lunarg.com/sdk/latest.json" | ConvertFrom-Json).windows | |
echo Version $ver | |
Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/$ver/windows/vulkansdk-windows-X64-$ver.exe" -OutFile VulkanSDK.exe | |
echo Downloaded | |
.\VulkanSDK.exe --root ${{ env.VULKAN_SDK }} --accept-licenses --default-answer --confirm-command install | |
- name: Set up Ninja | |
run: choco install ninja | |
- name: Set up Clang | |
uses: egor-tensin/setup-clang@v1 | |
with: | |
version: 18 | |
- name: Setup MSVC | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Setup Qt | |
uses: jurplel/install-qt-action@v4 | |
with: | |
version: "6.8.*" | |
host: 'windows' | |
target: 'desktop' | |
modules: 'qtwebengine qtpositioning qtwebchannel qtwebsockets qtserialport' | |
- name: Install pip dependencies | |
run: | | |
${{ env.pythonLocation }}\python.exe -m pip install --upgrade pip | |
${{ env.pythonLocation }}\python.exe -m pip install --upgrade setuptools wheel | |
${{ env.pythonLocation }}\python.exe -m pip install --user --upgrade scons protobuf grpcio-tools pyinstaller | |
${{ env.pythonLocation }}\python.exe -m pip install --user --upgrade meson | |
${{ env.pythonLocation }}\python.exe -c 'import google.protobuf; print(google.protobuf.__file__)' | |
- name: Setup ffmpeg | |
run: | | |
$ProgressPreference = 'SilentlyContinue' | |
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" | |
Expand-Archive -LiteralPath "ffmpeg-n7.1-latest-win64-gpl-shared-7.1.zip" -DestinationPath "." | |
Rename-Item "ffmpeg-n7.1-latest-win64-gpl-shared-7.1" "${{ env.dep_folder }}" | |
- name: Build SPIRV-Cross | |
run: | | |
git clone https://github.com/KhronosGroup/SPIRV-Cross.git | |
cd SPIRV-Cross | |
cmake ` | |
-DCMAKE_BUILD_TYPE=Release ` | |
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}\${{ env.dep_folder }}" ` | |
-DSPIRV_CROSS_SHARED=ON ` | |
-S . ` | |
-B build ` | |
-G Ninja | |
cmake --build build --config Release | |
cmake --install build | |
- name: Setup shaderc | |
run: | | |
$ProgressPreference = 'SilentlyContinue' | |
$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 | |
Invoke-WebRequest -UseBasicParsing -Uri $url -OutFile .\shaderc.zip | |
Expand-Archive -LiteralPath "shaderc.zip" -DestinationPath "." | |
cp "./install/*" "./${{ env.dep_folder }}" -Force -Recurse | |
rm "./install" -r -force | |
- name: Make build directory | |
run: | | |
mkdir build | |
- name: Setup vcpkg | |
uses: lukka/run-vcpkg@v11 | |
with: | |
vcpkgGitCommitId: ${{ env.vcpkg_baseline }} | |
runVcpkgInstall: true | |
vcpkgJsonGlob: "vcpkg.json" | |
- name: Build libplacebo | |
run: | | |
git clone --recursive https://github.com/haasn/libplacebo.git | |
cd libplacebo | |
git checkout --recurse-submodules ${{ env.libplacebo_tag }} | |
meson setup ` | |
--prefix "${{ github.workspace }}\${{ env.dep_folder }}" ` | |
--native-file ../meson.ini ` | |
"--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']" ` | |
"--cmake-prefix-path=['${env:VCPKG_INSTALLED_DIR}\${{ env.triplet }}', '${{ env.VULKAN_SDK }}', '${{ github.workspace }}\${{ env.dep_folder }}']" ` | |
-Dc_args="/I ${{ env.VULKAN_SDK }}Include" ` | |
-Dcpp_args="/I ${{ env.VULKAN_SDK }}Include" ` | |
-Dc_link_args="/LIBPATH:${{ env.VULKAN_SDK }}Lib" ` | |
-Dcpp_link_args="/LIBPATH:${{ env.VULKAN_SDK }}Lib" ` | |
-Ddemos=false ` | |
./build | |
ninja -C./build | |
ninja -C./build install | |
- name: Apply Patches | |
run: | | |
git apply --ignore-whitespace --verbose --directory=third-party/gf-complete/ scripts/windows-vc/gf-complete.patch | |
- name: Configure chiaki-ng | |
run: | | |
cmake ` | |
-S . ` | |
-B build ` | |
-G Ninja ` | |
-DCMAKE_TOOLCHAIN_FILE:STRING="vcpkg/scripts/buildsystems/vcpkg.cmake" ` | |
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE ` | |
-DCMAKE_BUILD_TYPE=Release ` | |
-DCHIAKI_ENABLE_CLI=OFF ` | |
-DCHIAKI_GUI_ENABLE_SDL_GAMECONTROLLER=ON ` | |
-DCHIAKI_ENABLE_STEAMDECK_NATIVE=OFF ` | |
-DPYTHON_EXECUTABLE="${{ env.pythonLocation }}\python.exe" ` | |
-DCMAKE_PREFIX_PATH="${{ github.workspace }}\${{ env.dep_folder }};${{ env.VULKAN_SDK }}" | |
- name: Build chiaki-ng | |
run: | | |
cmake --build build --config Release --clean-first --target chiaki | |
- name: Prepare Qt deployment package | |
run: | | |
mkdir chiaki-ng-Win | |
cp build\gui\chiaki.exe chiaki-ng-Win | |
cp build\third-party\cpp-steam-tools\cpp-steam-tools.dll chiaki-ng-Win | |
cp scripts\qtwebengine_import.qml gui\src\qml\ | |
cp "${env:VCPKG_INSTALLED_DIR}\${{ env.triplet }}\bin\libcrypto-*-x64.dll" chiaki-ng-Win | |
cp "${env:VCPKG_INSTALLED_DIR}\${{ env.triplet }}\bin\libssl-*-x64.dll" chiaki-ng-Win | |
cp "${env:VCPKG_INSTALLED_DIR}\${{ env.triplet }}\bin\SDL2.dll" chiaki-ng-Win | |
cp "${env:VCPKG_INSTALLED_DIR}\${{ env.triplet }}\bin\hidapi.dll" chiaki-ng-Win | |
cp "${env:VCPKG_INSTALLED_DIR}\${{ env.triplet }}\bin\fftw3.dll" chiaki-ng-Win | |
cp "${env:VCPKG_INSTALLED_DIR}\${{ env.triplet }}\bin\opus.dll" chiaki-ng-Win | |
cp "${env:VCPKG_INSTALLED_DIR}\${{ env.triplet }}\bin\libspeexdsp.dll" chiaki-ng-Win | |
cp "${env:VCPKG_INSTALLED_DIR}\${{ env.triplet }}\bin\lcms2.dll" chiaki-ng-Win | |
cp "${env:VCPKG_INSTALLED_DIR}\${{ env.triplet }}\bin\miniupnpc.dll" chiaki-ng-Win | |
cp "${env:VCPKG_INSTALLED_DIR}\${{ env.triplet }}\bin\json-c.dll" chiaki-ng-Win | |
cp "${{ github.workspace }}\${{ env.dep_folder }}\bin\swresample-*.dll" chiaki-ng-Win | |
cp "${{ github.workspace }}\${{ env.dep_folder }}\bin\avcodec-*.dll" chiaki-ng-Win | |
cp "${{ github.workspace }}\${{ env.dep_folder }}\bin\avutil-*.dll" chiaki-ng-Win | |
cp "${{ github.workspace }}\${{ env.dep_folder }}\bin\avformat-*.dll" chiaki-ng-Win | |
cp "${{ github.workspace }}\${{ env.dep_folder }}\bin\libplacebo-*.dll" chiaki-ng-Win | |
cp "${{ github.workspace }}\${{ env.dep_folder }}\bin\shaderc_shared.dll" chiaki-ng-Win | |
cp "${{ github.workspace }}\${{ env.dep_folder }}\bin\spirv-cross-c-shared.dll" chiaki-ng-Win | |
windeployqt.exe --no-translations --qmldir=gui\src\qml --release chiaki-ng-Win\chiaki.exe | |
- name: Package chiaki-ng | |
run: | | |
$CHIAKI_VERSION_MAJOR = (Select-String -Path .\CMakeLists.txt -Pattern 'set\(CHIAKI_VERSION_MAJOR ([0-9]+)\)') | %{$_.Matches.Groups[1].value} | |
$CHIAKI_VERSION_MINOR = (Select-String -Path .\CMakeLists.txt -Pattern 'set\(CHIAKI_VERSION_MINOR ([0-9]+)\)') | %{$_.Matches.Groups[1].value} | |
$CHIAKI_VERSION_PATCH = (Select-String -Path .\CMakeLists.txt -Pattern 'set\(CHIAKI_VERSION_PATCH ([0-9]+)\)') | %{$_.Matches.Groups[1].value} | |
$RELEASE_PACKAGE_FILE = "chiaki-ng-win_x64-VC-portable-$CHIAKI_VERSION_MAJOR.$CHIAKI_VERSION_MINOR.$CHIAKI_VERSION_PATCH-test-build-${{ github.sha }}.zip" | |
Compress-Archive chiaki-ng-Win $RELEASE_PACKAGE_FILE | |
$release_filepath = Get-ChildItem $RELEASE_PACKAGE_FILE | %{$_[0].FullName} | |
echo "RELEASE_PACKAGE_PATH=$release_filepath" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Upload chiaki-ng Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: chiaki-ng-win_x64-VC-Release | |
path: ${{ env.RELEASE_PACKAGE_PATH }} | |
if-no-files-found: error | |
retention-days: 7 | |
- name: Compile .ISS to .EXE Installer | |
uses: Minionguyjpro/Inno-Setup-Action@v1.2.2 | |
with: | |
path: "scripts/chiaki-ng.iss" | |
options: /O+ | |
- name: Upload chiaki-ng Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: chiaki-ng-win_x64-VC-installer.zip | |
path: chiaki-ng-windows-installer.exe | |
if-no-files-found: error | |
retention-days: 7 |