Debian Codegraph @

.github/workflows/windows.yml

raw symbols SCIP
1 name: windows
2
3 on:
4 workflow_dispatch:
5 push:
6 branches: [ master ]
7 tags:
8 - "v*"
9 pull_request:
10
11 jobs:
12 test-windows:
13 runs-on: windows-2022
14 steps:
15 - name: Checkout
16 uses: actions/checkout@v4
17
18 - name: Set up build variables
19 run: bash ./.github/scripts/setup_build_variables.sh
20
21 - name: Set up windows build variables
22 run: bash ./.github/scripts/windows/setup_windows_build_variables.sh
23
24 - name: Install Qt
25 uses: jurplel/install-qt-action@v4
26 with:
27 version: '5.15.2'
28 host: 'windows'
29 install-deps: 'true'
30 arch: 'win64_msvc2019_64'
31
32 - name: Set up nmake
33 uses: ilammy/msvc-dev-cmd@v1
34
35 - name: Set up kColorPicker
36 env:
37 BUILD_TYPE: Debug
38 run: bash ./.github/scripts/setup_kColorPicker.sh
39
40 - name: Set up kImageAnnotator
41 env:
42 BUILD_TYPE: Debug
43 run: bash ./.github/scripts/setup_kImageAnnotator.sh
44
45 - name: Set up GoogleTest
46 run: bash ./.github/scripts/setup_googleTest.sh
47
48 - name: Add GoogleTest bin dir to PATH
49 uses: myci-actions/export-env-var-powershell@1
50 with:
51 name: PATH
52 value: $env:PATH;$env:INSTALL_PREFIX/bin
53
54 - name: Build
55 env:
56 BUILD_TESTS: ON
57 BUILD_TYPE: Debug
58 run: bash ./.github/scripts/build_ksnip.sh
59
60 - name: Test
61 working-directory: ${{github.workspace}}/build/tests
62 run: ctest --extra-verbose
63
64
65 package-exe:
66 if: ${{ github.event_name == 'push' }}
67 runs-on: windows-2022
68 needs: test-windows
69 steps:
70 - name: Checkout
71 uses: actions/checkout@v4
72
73 - name: Set up build variables
74 run: bash ./.github/scripts/setup_build_variables.sh
75
76 - name: Set up windows build variables
77 run: bash ./.github/scripts/windows/setup_windows_build_variables.sh
78
79 - name: Install Qt
80 uses: jurplel/install-qt-action@v4
81 with:
82 version: '5.15.2'
83 host: 'windows'
84 install-deps: 'true'
85 arch: 'win64_msvc2019_64'
86
87 - name: Set up nmake
88 uses: ilammy/msvc-dev-cmd@v1
89
90 - name: Set up kColorPicker
91 run: bash ./.github/scripts/setup_kColorPicker.sh
92
93 - name: Set up kImageAnnotator
94 run: bash ./.github/scripts/setup_kImageAnnotator.sh
95
96 - name: Build
97 run: bash ./.github/scripts/build_ksnip.sh
98
99 - name: Download OpenSSL
100 run: |
101 curl -L "https://github.com/ksnip/dependencies/raw/master/windows/openSSL.zip" --output openssl.zip
102 7z x openssl.zip -o"${{ env.OPENSSL_DIR }}"
103
104 - name: Download CompileRuntime
105 run: |
106 curl -L "https://github.com/ksnip/dependencies/raw/master/windows/compileRuntime.zip" --output compileruntime.zip
107 7z x compileruntime.zip -o"${{ env.COMPILE_RUNTIME_DIR }}"
108
109 - name: Package exe
110 run: bash ./.github/scripts/windows/package_exe.sh
111
112 - name: Upload Artifact
113 uses: actions/upload-artifact@v4
114 with:
115 name: ksnip-windows.zip
116 path: ksnip-*.zip
117
118 - name: Delete existing release with same name
119 env:
120 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
121 run: bash ./.github/scripts/delete_release.sh
122
123 - name: Upload Release
124 uses: svenstaro/upload-release-action@v2
125 with:
126 repo_token: ${{ secrets.GITHUB_TOKEN }}
127 file: ksnip-${{ env.VERSION }}-windows.zip
128 asset_name: ksnip-${{ env.VERSION }}-windows.zip
129 tag: ${{ env.RELEASE_TAG }}
130 overwrite: true
131 release_name: ${{ env.RELEASE_NAME }}
132 body: ${{ env.UPLOADTOOL_BODY }}
133 prerelease: ${{ env.IS_PRERELASE }}
134
135
136 package-msi:
137 if: ${{ github.event_name == 'push' }}
138 runs-on: windows-2022
139 needs: test-windows
140 steps:
141 - name: Checkout
142 uses: actions/checkout@v4
143
144 - name: Set up build variables
145 run: bash ./.github/scripts/setup_build_variables.sh
146
147 - name: Set up windows build variables
148 run: bash ./.github/scripts/windows/setup_windows_build_variables.sh
149
150 - name: Install Qt
151 uses: jurplel/install-qt-action@v4
152 with:
153 version: '5.15.2'
154 host: 'windows'
155 install-deps: 'true'
156 arch: 'win64_msvc2019_64'
157
158 - name: Set up nmake
159 uses: ilammy/msvc-dev-cmd@v1
160
161 - name: Set up kColorPicker
162 run: bash ./.github/scripts/setup_kColorPicker.sh
163
164 - name: Set up kImageAnnotator
165 run: bash ./.github/scripts/setup_kImageAnnotator.sh
166
167 - name: Download OpenSSL
168 run: |
169 curl -L "https://github.com/ksnip/dependencies/raw/master/windows/openSSL.zip" --output openssl.zip
170 7z x openssl.zip -o"${{ env.OPENSSL_DIR }}"
171
172 - name: Download CompileRuntime
173 run: |
174 curl -L "https://github.com/ksnip/dependencies/raw/master/windows/compileRuntime.zip" --output compileruntime.zip
175 7z x compileruntime.zip -o"${{ env.COMPILE_RUNTIME_DIR }}"
176
177 - name: Build
178 run: bash ./.github/scripts/build_ksnip.sh
179
180 - name: Package msi
181 run: bash ./.github/scripts/windows/msi/package_msi.sh
182
183 - name: Sign msi
184 env:
185 MICROSOFT_CERT_PFX: ${{ secrets.MICROSOFT_CERT_PFX }}
186 MICROSOFT_CERT_PFX_PASS: ${{ secrets.MICROSOFT_CERT_PFX_PASS }}
187 run: powershell ./.github/scripts/windows/msi/sign_msi_package.ps1
188
189 - name: Upload Artifact
190 uses: actions/upload-artifact@v4
191 with:
192 name: ksnip-windows.msi
193 path: ksnip-*.msi
194
195 - name: Delete existing release with same name
196 env:
197 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
198 run: bash ./.github/scripts/delete_release.sh
199
200 - name: Upload Release
201 uses: svenstaro/upload-release-action@v2
202 with:
203 repo_token: ${{ secrets.GITHUB_TOKEN }}
204 file: ksnip-${{ env.VERSION }}.msi
205 asset_name: ksnip-${{ env.VERSION }}.msi
206 tag: ${{ env.RELEASE_TAG }}
207 overwrite: true
208 release_name: ${{ env.RELEASE_NAME }}
209 body: ${{ env.UPLOADTOOL_BODY }}
210 prerelease: ${{ env.IS_PRERELASE }}