-
Notifications
You must be signed in to change notification settings - Fork 236
262 lines (218 loc) · 6.9 KB
/
preview_release.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
252
253
254
255
256
257
258
259
260
261
262
name: Preview Release
on:
push:
tags:
- "v*"
pull_request:
branches:
- "*"
workflow_dispatch:
jobs:
upload-release:
if: ${{ (github.event_name == 'workflow_dispatch') || (github.event_name != 'pull_request') }}
runs-on: ubuntu-20.04
needs: [build-mac, build-mac-arm, build-linux, build-windows]
steps:
- uses: actions/checkout@v1
- name: create release
id: create_release
uses: actions/create-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.sha }}
draft: false
prerelease: true
- name: download artifacts
uses: actions/download-artifact@v4
# with:
# name: uploads
- name: upload mac
id: upload-mac
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./mac-uploads/sioyek-release-mac.zip
asset_name: sioyek-release-mac.zip
asset_content_type: application/zip
- name: upload mac arm
id: upload-mac-arm
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./mac-arm-uploads/sioyek-release-mac-arm.zip
asset_name: sioyek-release-mac-arm.zip
asset_content_type: application/zip
- name: upload linux
id: upload-linux
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./linux-uploads/sioyek-release-linux.zip
asset_name: sioyek-release-linux.zip
asset_content_type: application/zip
- name: upload windows
id: upload-windows
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./windows-uploads/sioyek-release-windows.zip
asset_name: sioyek-release-windows.zip
asset_content_type: application/zip
build-linux:
runs-on: ubuntu-20.04
steps:
- name: Cache apt-get packages
uses: actions/cache@v4
env:
cache-name: cache-deb-packages
with:
path: /var/cache/apt/archives
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install LinuxDeploy
uses: miurahr/install-linuxdeploy-action@v1
with:
plugins: qt appimage
- name: Set up GCC
uses: egor-tensin/setup-gcc@v1
with:
version: 9
platform: x64
- uses: actions/checkout@v4
with:
submodules: 'recursive'
ref: development
- name: Install dependencies
run: sudo apt install libharfbuzz-dev libxrandr-dev libxi-dev libglu1-mesa-dev fuse libxcb-cursor0 libspeechd2
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.7.2'
modules: 'all'
cache: true
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
run: MAKE_PARALLEL=$(nproc) ./linuxdeploy_build_and_release.sh
env:
CC: gcc-9
CXX: g++-9
- name: upload linux artifact
uses: actions/upload-artifact@v4
with:
name: linux-uploads
path: sioyek-release-linux.zip
- name: Workaround apt-get cache permission (https://github.com/actions/cache/issues/324)
run: |
export USER_NAME=$(whoami)
sudo chown -R $USER_NAME /var/cache/apt/archives
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
ref: development
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.7.2'
modules: 'all'
cache: true
- name: Add MSBuild to PATH
uses: microsoft/[email protected]
- name: Add msvc-dev-cmd
uses: ilammy/msvc-dev-cmd@v1
- name: Build Sioyek
working-directory: ${{env.GITHUB_WORKSPACE}}
run: .\build_windows.bat non_portable
- name: upload windows artifact
uses: actions/upload-artifact@v4
with:
name: windows-uploads
path: sioyek-release-windows.zip
build-mac:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
ref: development
- name: Cache Homebrew packages
uses: actions/cache@v4
env:
cache-name: homebrew
with:
path: ~/Library/Caches/Homebrew
key: ${{ runner.os }}-intel-build-${{ env.cache-name }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-intel-build-${{ env.cache-name }}-
${{ runner.os }}-intel-build-
${{ runner.os }}-intel-
- name: Install dependencies
run: brew install freeglut mesa harfbuzz
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.7.2'
modules: 'all'
cache: true
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
chmod +x build_mac.sh
MAKE_PARALLEL=$(sysctl -n hw.logicalcpu) ./build_mac.sh
- name: upload mac artifact
uses: actions/upload-artifact@v4
with:
name: mac-uploads
path: sioyek-release-mac.zip
build-mac-arm:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
ref: development
- name: Cache Homebrew packages
uses: actions/cache@v4
env:
cache-name: homebrew
with:
path: ~/Library/Caches/Homebrew
key: ${{ runner.os }}-arm-build-${{ env.cache-name }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-arm-build-${{ env.cache-name }}-
${{ runner.os }}-arm-build-
${{ runner.os }}-arm-
- name: Install dependencies
run: brew install freeglut mesa harfbuzz
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.7.2'
modules: 'all'
cache: true
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
chmod +x build_mac.sh
MAKE_PARALLEL=$(sysctl -n hw.logicalcpu) ./build_mac.sh
mv sioyek-release-mac.zip sioyek-release-mac-arm.zip
- name: upload mac artifact
uses: actions/upload-artifact@v4
with:
name: mac-arm-uploads
path: sioyek-release-mac-arm.zip