-
Notifications
You must be signed in to change notification settings - Fork 27
251 lines (215 loc) · 7.67 KB
/
build_starc_windows.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
name: Build Starc for Windows
env:
APP_VERSION: 0.7.6
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
create:
tags:
- v*
workflow_dispatch: {}
jobs:
build_windows_64:
name: Build Windows 64 version
runs-on: windows-latest
timeout-minutes: 60
steps:
- name: Checkout Sources for push or create tag event
if: ${{ github.event_name != 'pull_request' }}
uses: actions/checkout@master
with:
token: ${{ secrets.ACTION_RUNNER }}
submodules: recursive
fetch-depth: 0
- name: Checkout sources for pull request event
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@master
- name: Checkout submodules for pull request event
if: ${{ github.event_name == 'pull_request' }}
shell: bash
run: |
git submodule update --init --recursive src/3rd_party/qbreakpad/ src/3rd_party/pdfhummus/ src/3rd_party/pdftextextraction/
- name: Add info about dev build to the env
shell: bash
run: |
echo "DEV_BUILD=$(git rev-list `git rev-list --tags --no-walk --max-count=1`..HEAD --count)" >> $GITHUB_ENV
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 5.15.2
arch: win64_msvc2019_64
target: desktop
setup-python: false
- name: Install dependencies
shell: bash
run: |
choco install openssl --version=3.1.1
- name: Configure MSVC
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Run QMake
shell: bash
run: |
cd src
qmake starc.pro CONFIG+=release DEFINES+="DEV_BUILD=$DEV_BUILD"
- name: Build
run: |
cd src
nmake
- name: Prepare installer folder
shell: bash
run: |
cd build/windows
./make-exe_64.sh ${{env.APP_VERSION}}
- name: Make installer
uses: joncloud/[email protected]
with:
arguments: "/V3"
script-file: "build/windows/starc_64.nsi"
- name: Make archive with portable version
uses: vimtor/action-zip@v1
with:
files: build/windows/files_64
dest: build/windows/starc-64.zip
- name: Collect artifacts
uses: actions/upload-artifact@v4
with:
name: windows_64 packages
path: |
build/windows/starc-setup-64.exe
build/windows/starc-64.zip
- name: Publish artifacts to the dev stream and notify clients
if: startsWith(github.ref, 'refs/tags/') != true
shell: pwsh
env:
STARC_API_KEY: ${{ secrets.STARC_API_KEY }}
BUILD_VERSION: ${{env.APP_VERSION}} dev ${{env.DEV_BUILD}}
run: |
$PublishForm = @{
api_key = $env:STARC_API_KEY
name_for_file = 'starc-setup-64.exe'
file_bin = Get-Item -Path 'build\windows\starc-setup-64.exe'
}
Invoke-WebRequest -Uri 'https://starc.app/api/app/updates/publish' -Method Post -Form $PublishForm
$NotifyForm = @{
api_key = $env:STARC_API_KEY
system = 'windows64'
version = $env:BUILD_VERSION
}
Invoke-WebRequest -Uri 'https://starc.app/api/app/updates/notify' -Method Post -Form $NotifyForm
- name: Publish artifacts to the GitHub releases
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
build/windows/starc-setup-64.exe
build/windows/starc-64.zip
- name: Notify clients that stable release published
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
curl -F "api_key=${{ secrets.STARC_API_KEY }}" -F "system=windows64" -F "version=${{env.APP_VERSION}}" https://starc.app/api/app/updates/notify
build_windows_32:
name: Build Windows 32 version
runs-on: windows-latest
timeout-minutes: 60
steps:
- name: Checkout Sources for push or create tag event
if: ${{ github.event_name != 'pull_request' }}
uses: actions/checkout@master
with:
token: ${{ secrets.ACTION_RUNNER }}
submodules: recursive
fetch-depth: 0
- name: Checkout sources for pull request event
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@master
- name: Checkout submodules for pull request event
if: ${{ github.event_name == 'pull_request' }}
shell: bash
run: |
git submodule update --init --recursive src/3rd_party/qbreakpad/ src/3rd_party/pdfhummus/ src/3rd_party/pdftextextraction/
- name: Add info about dev build to the env
shell: bash
run: |
echo "DEV_BUILD=$(git rev-list `git rev-list --tags --no-walk --max-count=1`..HEAD --count)" >> $GITHUB_ENV
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 5.15.2
arch: win32_msvc2019
target: desktop
setup-python: false
- name: Install dependencies
shell: bash
run: |
choco install openssl --version=1.1.1.2100 --forcex86
- name: Configure MSVC
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86
- name: Run QMake
shell: bash
run: |
cd src
qmake starc.pro CONFIG+=release DEFINES+="DEV_BUILD=$DEV_BUILD"
- name: Build
run: |
cd src
nmake
- name: Prepare installer folder
shell: bash
run: |
cd build/windows
./make-exe_32.sh ${{env.APP_VERSION}}
- name: Make installer
uses: joncloud/[email protected]
with:
arguments: "/V3"
script-file: "build/windows/starc_32.nsi"
- name: Make archive with portable version
uses: vimtor/action-zip@v1
with:
files: build/windows/files_32
dest: build/windows/starc-32.zip
- name: Collect artifacts
uses: actions/upload-artifact@v4
with:
name: windows_32 packages
path: |
build/windows/starc-setup-32.exe
build/windows/starc-32.zip
- name: Publish artifacts to the dev stream and notify clients
if: startsWith(github.ref, 'refs/tags/') != true
shell: pwsh
env:
STARC_API_KEY: ${{ secrets.STARC_API_KEY }}
BUILD_VERSION: ${{env.APP_VERSION}} dev ${{env.DEV_BUILD}}
run: |
$PublishForm = @{
api_key = $env:STARC_API_KEY
name_for_file = 'starc-setup-32.exe'
file_bin = Get-Item -Path 'build\windows\starc-setup-32.exe'
}
Invoke-WebRequest -Uri 'https://starc.app/api/app/updates/publish' -Method Post -Form $PublishForm
$NotifyForm = @{
api_key = $env:STARC_API_KEY
system = 'windows32'
version = $env:BUILD_VERSION
}
Invoke-WebRequest -Uri 'https://starc.app/api/app/updates/notify' -Method Post -Form $NotifyForm
- name: Publish artifacts to GitHub releases
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
build/windows/starc-setup-32.exe
build/windows/starc-32.zip
- name: Notify clients that stable release published
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
curl -F "api_key=${{ secrets.STARC_API_KEY }}" -F "system=windows32" -F "version=${{env.APP_VERSION}}" https://starc.app/api/app/updates/notify