-
Notifications
You must be signed in to change notification settings - Fork 4
138 lines (112 loc) · 3.87 KB
/
windows-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: Build-Windows
on:
push:
branches:
- master
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
env:
VCPKG_OVERLAY_PORTS: ${{ github.workspace }}/.github/vcpkg_overlays/qt
jobs:
build-dependencies:
name: "Build PhotoBroom dependencies for Windows"
runs-on: windows-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Run vcpkg
uses: lukka/run-vcpkg@v11.5
with:
vcpkgJsonGlob: vcpkg.json
# builded dependencies will be cached and reused in later jobs
- name: build dependencies
run: |
vcpkg\vcpkg.exe install
build-photo-broom:
name: "Build PhotoBroom sources on Windows"
needs: build-dependencies
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
config:
- name: "debug"
cmake_config: "ninja_debug_vcpkg"
cmake_build: "Ninja Debug"
- name: "release"
cmake_config: "ninja_release_vcpkg"
cmake_build: "Ninja Release"
steps:
- name: Print setup
run: |
echo "config: ${{ matrix.config.cmake_config }}"
echo "build: ${{ matrix.config.cmake_build }}"
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.7.2'
cache: 'true'
modules: 'qtmultimedia qtquick3d qtshadertools qtquicktimeline'
- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
with:
windows_compile_environment: msvc
- name: Run vcpkg
uses: lukka/run-vcpkg@v11.5
with:
vcpkgJsonGlob: vcpkg.json
- name: Build
uses: lukka/run-cmake@v10
with:
configurePreset: ${{ matrix.config.cmake_config }}
configurePresetAdditionalArgs: |
[
'-DBUILD_TESTING=OFF',
'-DBUILD_SHARED_LIBS=TRUE',
'-DCMAKE_CXX_COMPILER_LAUNCHER:FILEPATH=C:/ProgramData/Chocolatey/bin/ccache.exe',
'-DCMAKE_C_COMPILER_LAUNCHER:FILEPATH=C:/ProgramData/Chocolatey/bin/ccache.exe'
]
buildPreset: "${{ matrix.config.cmake_build }}"
- name: Make package
if: matrix.config.name == 'release'
run: cmake --build --target package --preset "${{ matrix.config.cmake_build }}"
- name: Upload artifact
if: matrix.config.name == 'release'
uses: actions/upload-artifact@v4
with:
name: Installer
path: out/build/ninja_release_vcpkg/PhotoBroom-*-win64.exe
test-installation:
name: "Windows installer verification"
needs: build-photo-broom
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: Installer
path: ./installer
- name: Verify list of files in installer
run: |
$installerPath = Get-ChildItem -Path ./installer -Filter PhotoBroom-*-win64.exe | Select-Object -ExpandProperty FullName
7z l $installerPath | python .github/parse7z-l.py | python .github/compare.py
- name: Install application
run: |
$installerPath = Get-ChildItem -Path ./installer -Filter PhotoBroom-*-win64.exe | Select-Object -ExpandProperty FullName
Start-Process -FilePath $installerPath -ArgumentList '/S' -Wait
- name: Get dependencies checker
run: |
curl -L -o dependencies_valdiator.py https://gist.githubusercontent.com/Kicer86/4727b1a1ecb96e717ea1c37866134cf4/raw/d7b6f0bc01515a2ba5c17fedd7832038880f62d6/dependencies_valdiator.py
- name: Check dependencies
run: |
pip install pefile
python dependencies_valdiator.py "C:\Program Files\PhotoBroom\Photo_Broom.exe"