2022-05-29 01:06:00 +08:00
|
|
|
name: Windows CI
|
|
|
|
|
2024-10-12 14:14:52 +08:00
|
|
|
on: [push, pull_request, workflow_dispatch]
|
2022-05-29 01:06:00 +08:00
|
|
|
|
|
|
|
jobs:
|
2024-07-06 14:09:00 +08:00
|
|
|
msvc-qmake-build:
|
2022-05-29 01:06:00 +08:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-07-06 14:09:00 +08:00
|
|
|
vs: ['2022']
|
2022-05-29 01:06:00 +08:00
|
|
|
msvc_arch: ['x64']
|
2024-07-13 00:36:22 +08:00
|
|
|
qt_ver: ['6.7.2']
|
2022-05-29 01:06:00 +08:00
|
|
|
|
2024-07-06 14:09:00 +08:00
|
|
|
runs-on: windows-2022
|
2022-05-29 01:06:00 +08:00
|
|
|
|
|
|
|
steps:
|
2024-02-16 13:29:43 +08:00
|
|
|
- uses: actions/checkout@v4
|
2022-05-29 01:06:00 +08:00
|
|
|
- name: Install Qt
|
2024-07-13 00:36:22 +08:00
|
|
|
uses: jurplel/install-qt-action@v4
|
2022-05-29 01:06:00 +08:00
|
|
|
with:
|
|
|
|
arch: 'win64_msvc2019_64'
|
2024-07-13 00:36:22 +08:00
|
|
|
version: ${{ matrix.qt_ver }}
|
|
|
|
modules: 'qtimageformats'
|
2022-05-29 01:06:00 +08:00
|
|
|
- name: Build
|
|
|
|
shell: cmd
|
|
|
|
run: |
|
|
|
|
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 }}
|
|
|
|
qmake pineapple-pictures.pro
|
|
|
|
nmake
|
2024-07-06 16:38:45 +08:00
|
|
|
nmake clean
|
2024-07-13 00:36:22 +08:00
|
|
|
windeployqt --verbose=2 --no-quick-import --no-translations --no-opengl-sw --no-system-d3d-compiler --no-system-dxc-compiler --skip-plugin-types tls,networkinformation release\ppic.exe
|
2024-07-06 14:09:00 +08:00
|
|
|
- uses: actions/upload-artifact@v4
|
|
|
|
with:
|
2024-07-13 00:36:22 +08:00
|
|
|
name: "windows-msvc${{ matrix.vs }}-qt${{ matrix.qt_ver }}-qmake-package"
|
2024-07-06 14:09:00 +08:00
|
|
|
path: release/*
|
|
|
|
|
|
|
|
msvc-cmake-build:
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
vs: ['2022']
|
|
|
|
msvc_arch: ['x64']
|
2024-07-13 00:36:22 +08:00
|
|
|
qt_ver: ['6.7.2']
|
2024-07-06 14:09:00 +08:00
|
|
|
|
|
|
|
runs-on: windows-2022
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Qt
|
2024-07-13 00:36:22 +08:00
|
|
|
uses: jurplel/install-qt-action@v4
|
2024-07-06 14:09:00 +08:00
|
|
|
with:
|
|
|
|
arch: 'win64_msvc2019_64'
|
2024-07-13 00:36:22 +08:00
|
|
|
version: ${{ matrix.qt_ver }}
|
|
|
|
modules: 'qtimageformats'
|
2024-07-06 14:09:00 +08:00
|
|
|
- name: Build
|
|
|
|
shell: cmd
|
|
|
|
run: |
|
2024-07-13 00:36:22 +08:00
|
|
|
:: ------ env ------
|
2024-07-06 14:09:00 +08:00
|
|
|
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 }}
|
2024-07-13 00:36:22 +08:00
|
|
|
:: ------ dep ------
|
|
|
|
set CMAKE_PREFIX_PATH=%PWD%/dependencies_bin
|
|
|
|
mkdir dependencies_src
|
2024-08-24 14:15:25 +08:00
|
|
|
:: ===== exiv2 =====
|
2024-07-13 00:36:22 +08:00
|
|
|
curl -fsSL -o exiv2_bin.zip https://github.com/Exiv2/exiv2/releases/download/v0.28.3/exiv2-0.28.3-2019msvc64.zip
|
|
|
|
7z x exiv2_bin.zip -y
|
|
|
|
ren .\exiv2-0.28.3-2019msvc64 dependencies_bin
|
2024-08-24 14:15:25 +08:00
|
|
|
:: ===== zlib =====
|
2024-07-13 00:36:22 +08:00
|
|
|
curl -fsSL -o zlib_src.zip https://zlib.net/zlib131.zip
|
|
|
|
7z x zlib_src.zip -y -o"dependencies_src"
|
|
|
|
ren .\dependencies_src\zlib-1.3.1 zlib || goto :error
|
|
|
|
cmake ./dependencies_src/zlib -Bbuild_dependencies/zlib -DCMAKE_INSTALL_PREFIX="dependencies_bin" || goto :error
|
|
|
|
cmake --build build_dependencies/zlib --config Release --target=install || goto :error
|
|
|
|
curl -fsSL -o expat_src.zip https://github.com/libexpat/libexpat/archive/R_2_6_2.zip
|
2024-08-24 14:15:25 +08:00
|
|
|
:: ===== expat =====
|
2024-07-13 00:36:22 +08:00
|
|
|
7z x expat_src.zip -y -o"dependencies_src"
|
|
|
|
ren .\dependencies_src\libexpat-R_2_6_2 expat || goto :error
|
|
|
|
cmake ./dependencies_src/expat/expat -Bbuild_dependencies/expat -DCMAKE_INSTALL_PREFIX="dependencies_bin" || goto :error
|
|
|
|
cmake --build build_dependencies/expat --config Release --target=install || goto :error
|
2024-08-24 14:15:25 +08:00
|
|
|
:: ===== ECM =====
|
|
|
|
git clone -q https://invent.kde.org/frameworks/extra-cmake-modules.git dependencies_src/extra-cmake-modules
|
|
|
|
cmake .\dependencies_src\extra-cmake-modules -Bbuild_dependencies/extra-cmake-modules -DCMAKE_INSTALL_PREFIX="dependencies_bin" -DBUILD_TESTING=OFF || goto :error
|
|
|
|
cmake --build build_dependencies/extra-cmake-modules --config Release --target=install || goto :error
|
|
|
|
:: ===== KArchive =====
|
|
|
|
git clone -q https://invent.kde.org/frameworks/karchive.git dependencies_src/karchive
|
|
|
|
cmake .\dependencies_src\karchive -Bbuild_dependencies/karchive -DWITH_LIBZSTD=OFF -DWITH_BZIP2=OFF -DWITH_LIBLZMA=OFF -DCMAKE_INSTALL_PREFIX="dependencies_bin" || goto :error
|
|
|
|
cmake --build build_dependencies/karchive --config Release --target=install || goto :error
|
|
|
|
:: ===== KImageFormats =====
|
|
|
|
git clone -q https://invent.kde.org/frameworks/kimageformats.git dependencies_src/kimageformats
|
|
|
|
cmake .\dependencies_src\kimageformats -Bbuild_dependencies/kimageformats -DKDE_INSTALL_QTPLUGINDIR=%QT_ROOT_DIR%\plugins || goto :error
|
|
|
|
cmake --build build_dependencies/kimageformats --config Release --target=install || goto :error
|
2024-07-13 00:36:22 +08:00
|
|
|
:: ------ app ------
|
|
|
|
cmake -Bbuild . -DCMAKE_INSTALL_PREFIX="%PWD%\build\"
|
2024-07-06 14:09:00 +08:00
|
|
|
cmake --build build --config Release
|
|
|
|
cmake --build build --config Release --target=install
|
2024-07-13 00:36:22 +08:00
|
|
|
:: ------ pkg ------
|
|
|
|
windeployqt --verbose=2 --no-quick-import --no-translations --no-opengl-sw --no-system-d3d-compiler --no-system-dxc-compiler --skip-plugin-types tls,networkinformation build\bin\ppic.exe
|
|
|
|
robocopy ./dependencies_bin/bin build/bin *.dll
|
|
|
|
if ErrorLevel 8 (exit /B 1)
|
2024-10-12 14:14:52 +08:00
|
|
|
copy LICENSE build\bin
|
2024-07-13 00:36:22 +08:00
|
|
|
exit /B 0
|
2024-07-06 14:09:00 +08:00
|
|
|
- uses: actions/upload-artifact@v4
|
|
|
|
with:
|
2024-07-13 00:36:22 +08:00
|
|
|
name: "windows-msvc${{ matrix.vs }}-qt${{ matrix.qt_ver }}-cmake-package"
|
2024-07-06 14:09:00 +08:00
|
|
|
path: build/bin/*
|