2024-09-07 00:48:09 +08:00
|
|
|
name: Windows CI
|
|
|
|
|
|
|
|
on: [push, pull_request, workflow_dispatch]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
msvc-cmake-build:
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
vs: ['2022']
|
|
|
|
msvc_arch: ['x64']
|
|
|
|
qt_ver: ['6.7.2']
|
|
|
|
|
|
|
|
runs-on: windows-2022
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Qt
|
|
|
|
uses: jurplel/install-qt-action@v4
|
|
|
|
with:
|
|
|
|
arch: 'win64_msvc2019_64'
|
|
|
|
version: ${{ matrix.qt_ver }}
|
|
|
|
modules: 'qtmultimedia'
|
|
|
|
- name: Build
|
|
|
|
shell: cmd
|
|
|
|
run: |
|
|
|
|
:: ------ env ------
|
|
|
|
set PWD=%cd%
|
|
|
|
set VS=${{ matrix.vs }}
|
|
|
|
set VCVARS="C:\Program Files (x86)\Microsoft Visual Studio\%VS%\Enterprise\VC\Auxiliary\Build\vcvarsall.bat"
|
|
|
|
if not exist %VCVARS% set VCVARS="C:\Program Files\Microsoft Visual Studio\%VS%\Enterprise\VC\Auxiliary\Build\vcvarsall.bat"
|
|
|
|
call %VCVARS% ${{ matrix.msvc_arch }}
|
|
|
|
:: ------ dep ------
|
|
|
|
set CMAKE_PREFIX_PATH=%PWD%/dependencies_bin
|
|
|
|
mkdir dependencies_src
|
2024-09-22 14:27:53 +08:00
|
|
|
:: ===== uchardet =====
|
|
|
|
echo "::group::build uchardet"
|
|
|
|
git clone -q https://gitlab.freedesktop.org/BLumia/uchardet.git --branch msvc dependencies_src/uchardet
|
|
|
|
cmake .\dependencies_src\uchardet -Bbuild_dependencies/uchardet -DBUILD_BINARY=OFF -DCMAKE_INSTALL_PREFIX="dependencies_bin" || goto :error
|
|
|
|
cmake --build build_dependencies/uchardet --config Release --target=install -j || goto :error
|
|
|
|
echo "::endgroup::"
|
2024-09-07 00:48:09 +08:00
|
|
|
:: ===== pkg-config =====
|
|
|
|
choco install pkgconfiglite
|
|
|
|
set PKG_CONFIG_PATH=%PWD%/dependencies_bin/lib/pkgconfig
|
|
|
|
:: ===== taglib =====
|
|
|
|
git clone --recurse-submodules -q https://github.com/taglib/taglib.git dependencies_src/taglib
|
|
|
|
cmake .\dependencies_src\taglib -Bbuild_dependencies/taglib -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX="dependencies_bin" || goto :error
|
2024-09-07 12:14:54 +08:00
|
|
|
cmake --build build_dependencies/taglib --config Release --target=install -j || goto :error
|
2024-09-07 00:48:09 +08:00
|
|
|
:: ------ app ------
|
|
|
|
cmake -Bbuild . -DCMAKE_INSTALL_PREFIX="%PWD%\build\" || goto :error
|
2024-09-07 12:14:54 +08:00
|
|
|
cmake --build build --config Release -j || goto :error
|
2024-09-07 00:48:09 +08:00
|
|
|
cmake --build build --config Release --target=install
|
|
|
|
:: ------ pkg ------
|
|
|
|
windeployqt --verbose=2 --no-quick-import --no-translations --no-opengl-sw --no-system-d3d-compiler --no-system-dxc-compiler --multimedia --skip-plugin-types tls,networkinformation build\bin\pmusic.exe
|
|
|
|
robocopy ./dependencies_bin/bin build/bin *.dll
|
|
|
|
if ErrorLevel 8 (exit /B 1)
|
|
|
|
copy LICENSE build/bin/
|
|
|
|
exit /B 0
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: "windows-msvc${{ matrix.vs }}-qt${{ matrix.qt_ver }}-cmake-package"
|
|
|
|
path: build/bin/*
|