forked from texstudio-org/texstudio
-
Notifications
You must be signed in to change notification settings - Fork 0
380 lines (334 loc) · 15.8 KB
/
cd.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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
name: CD
on:
- push
- pull_request
permissions:
contents: read
env:
OSX_QT_VERSION: 6.7.1
OSX_POPPLER_VERSION: 24.05.0
OSX_QUAZIP_VERSION: 1.4
jobs:
build-win10:
name: win10 build (msys2)
if: github.event_name == 'push'
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: |
git make mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-toolchain mingw-w64-ucrt-x86_64-ninja
mingw-w64-ucrt-x86_64-qt6-base mingw-w64-ucrt-x86_64-qt6-declarative
mingw-w64-ucrt-x86_64-qt6-svg mingw-w64-ucrt-x86_64-qt6-5compat
mingw-w64-ucrt-x86_64-qt6-tools mingw-w64-ucrt-x86_64-poppler-qt6
mingw-w64-ucrt-x86_64-nsis mingw-w64-ucrt-x86_64-quazip-qt6
mingw-w64-ucrt-x86_64-hunspell mingw-w64-ucrt-x86_64-qt6-translations
mingw-w64-ucrt-x86_64-python-mingw-ldd zip unzip
- name: Fetch tag annotations
run: git fetch --tags --force
- name: Configure
run: |
mkdir build
cd build
. ../.github/scripts/get-version.sh
sed -i ../win.rc -Ee "s/0,[0,]+/$(tr <<<"$TXS_VERSION" . ,),0/"
sed -i ../win.rc -e "s/git[\]0/$VERSION_NAME/"
# qmake-qt6 texstudio.pro CONFIG-=debug MXE=1 BUILD_ADWAITA=1 STRIP=1
cmake .. -Wno-dev
# work-around strange git behaviour on msys2
. ../git_revision.sh
- name: Build
run: |
cd build
cmake --build . -- -j 2
- name: Package
id: package
run: |
cd build
. ../.github/scripts/get-version.sh
. ../.github/scripts/package_msys.sh
echo "VERSION_NAME=${VERSION_NAME}">> $GITHUB_OUTPUT
echo "TXS_VERSION=${TXS_VERSION}">> $GITHUB_OUTPUT
echo "GIT_VERSION=${GIT_VERSION}">> $GITHUB_OUTPUT
- name: Upload zip to GitHub Artifacts
if: github.event_name == 'push'
uses: actions/upload-artifact@v4
with:
name: texstudio-win-qt6-zip
path: ./build/package-zip/texstudio-win-qt6-${{ steps.package.outputs.VERSION_NAME }}.zip
- name: Upload to GitHub Artifacts
if: github.event_name == 'push'
uses: actions/upload-artifact@v4
with:
name: texstudio-win-qt6-exe
path: texstudio-win-qt6-${{ steps.package.outputs.VERSION_NAME }}.exe
- name: Upload release file(s)
uses: actions/upload-artifact@v4
if: startsWith(github.ref, 'refs/tags/')
with:
name: release-win
path: |
texstudio-${{ steps.package.outputs.GIT_VERSION }}-win-qt6.exe
texstudio-${{ steps.package.outputs.GIT_VERSION }}-win-portable-qt6.zip
###################################
build-linux-release:
name: linux appimage
if: github.event_name == 'push'
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch tag annotations
run: git fetch --tags --force
- name: Updates
run: sudo apt-get update
- name: Dependencies
run: sudo apt-get install qtbase5-dev qt5-default qt5-qmake libqt5svg5-dev qtdeclarative5-dev qttools5-dev libqt5svg5-dev libpoppler-qt5-dev libpoppler-cpp-dev pkg-config zlib1g-dev libquazip5-dev
- name: Configure
run: |
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=appdir/usr .. -Wno-dev
- name: Build
run: |
cd build
cmake --build . --target install -- -j 2
- name: Package
id: package
run: |
cd build
POPPLERDATA_VERSION="0.4.8"
POPPLERDATA_SUBDIR="poppler-data-${POPPLERDATA_VERSION}"
POPPLERDATA_FILE="poppler-data-${POPPLERDATA_VERSION}.tar.gz"
POPPLERDATA_URL="https://poppler.freedesktop.org/${POPPLERDATA_FILE}"
POPPLERDATA_SHA256="1096a18161f263cccdc6d8a2eb5548c41ff8fcf9a3609243f1b6296abdf72872"
. ../.github/scripts/package_linux.sh
echo "VERSION_NAME=${VERSION_NAME}" >> $GITHUB_OUTPUT
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
echo "TXS_VERSION=${TXS_VERSION}" >> $GITHUB_OUTPUT
echo "GIT_VERSION=${GIT_VERSION}" >> $GITHUB_OUTPUT
- name: Upload to Github Artifacts
if: github.event_name == 'push'
uses: actions/upload-artifact@v4
with:
name: texstudio-linux
path: texstudio-linux-${{ steps.package.outputs.VERSION_NAME }}-x86_64.AppImage
- name: Upload release file(s)
uses: actions/upload-artifact@v4
if: startsWith(github.ref, 'refs/tags/')
with:
name: release-linux
path: texstudio-${{ steps.package.outputs.GIT_VERSION }}-x86_64.AppImage
############################
macosx:
name: Mac OS X
if: true
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch tag annotations
run: git fetch --tags --force
- name: Install Dependencies
run: |
wget https://github.com/sunderme/homebrew-qt6-modules/releases/download/${{ env.OSX_QT_VERSION }}/QtBase-${{ env.OSX_QT_VERSION }}-Darwin.tar.xz
sudo tar xvf ./QtBase-${{ env.OSX_QT_VERSION }}-Darwin.tar.xz -C /usr/local
rm QtBase-${{ env.OSX_QT_VERSION }}-Darwin.tar.xz
wget https://github.com/sunderme/homebrew-qt6-modules/releases/download/${{ env.OSX_QT_VERSION }}/QtSvg-${{ env.OSX_QT_VERSION }}-Darwin.tar.xz
sudo tar xvf ./QtSvg-${{ env.OSX_QT_VERSION }}-Darwin.tar.xz -C /usr/local/QtBase-${{ env.OSX_QT_VERSION }}-Darwin --strip-components=1
rm QtSvg-${{ env.OSX_QT_VERSION }}-Darwin.tar.xz
wget https://github.com/sunderme/homebrew-qt6-modules/releases/download/${{ env.OSX_QT_VERSION }}/Qt5Compat-${{ env.OSX_QT_VERSION }}-Darwin.tar.xz
sudo tar xvf ./Qt5Compat-${{ env.OSX_QT_VERSION }}-Darwin.tar.xz -C /usr/local/QtBase-${{ env.OSX_QT_VERSION }}-Darwin --strip-components=1
rm Qt5Compat-${{ env.OSX_QT_VERSION }}-Darwin.tar.xz
wget https://github.com/sunderme/homebrew-qt6-modules/releases/download/${{ env.OSX_QT_VERSION }}/QtTools-${{ env.OSX_QT_VERSION }}-Darwin.tar.xz
sudo tar xvf ./QtTools-${{ env.OSX_QT_VERSION }}-Darwin.tar.xz -C /usr/local/QtBase-${{ env.OSX_QT_VERSION }}-Darwin --strip-components=1
rm QtTools-${{ env.OSX_QT_VERSION }}-Darwin.tar.xz
wget https://github.com/sunderme/homebrew-qt6-modules/releases/download/${{ env.OSX_QT_VERSION }}/QtDeclarative-${{ env.OSX_QT_VERSION }}-Darwin.tar.xz
sudo tar xvf ./QtDeclarative-${{ env.OSX_QT_VERSION }}-Darwin.tar.xz -C /usr/local/QtBase-${{ env.OSX_QT_VERSION }}-Darwin --strip-components=1
rm QtDeclarative-${{ env.OSX_QT_VERSION }}-Darwin.tar.xz
wget https://github.com/sunderme/homebrew-qt6-modules/releases/download/${{ env.OSX_QT_VERSION }}/poppler-${{ env.OSX_POPPLER_VERSION }}-Darwin.tar.xz
sudo tar xvf ./poppler-${{ env.OSX_POPPLER_VERSION}}-Darwin.tar.xz -C /usr/local --strip-components=1
rm poppler-${{ env.OSX_POPPLER_VERSION }}-Darwin.tar.xz
wget https://github.com/sunderme/homebrew-qt6-modules/releases/download/${{ env.OSX_QT_VERSION }}/QuaZip-${{ env.OSX_QUAZIP_VERSION }}-Darwin.tar.xz
sudo tar xvf ./QuaZip-${{ env.OSX_QUAZIP_VERSION }}-Darwin.tar.xz -C /usr/local --strip-components=1
rm QuaZip-${{ env.OSX_QUAZIP_VERSION }}-Darwin.tar.xz
brew install cairo fontconfig freetype gettext jpeg libpng libtiff little-cms2 openjpeg
brew install ninja pkg-config
- name: Configure
run: |
mkdir build
cd build
/usr/local/QtBase-${{ env.OSX_QT_VERSION }}-Darwin/bin/qt-cmake .. -G Ninja
- name: Build
run: |
cd build
cmake --build . --parallel
- name: Workarounds
run: |
cd build
mkdir -p texstudio.app/Contents/Frameworks
cp /usr/local/lib/libbrotlicommon.1.dylib texstudio.app/Contents/Frameworks
touch texstudio.app/Contents/Resources/empty.lproj
- name: poppler data
run: |
cd build
wget https://poppler.freedesktop.org/poppler-data-0.4.12.tar.gz
tar xvf poppler-data-0.4.12.tar.gz
mkdir -p texstudio.app/Contents/share/poppler
cp -r poppler-data-0.4.12/cidToUnicode texstudio.app/Contents/share/poppler
cp -r poppler-data-0.4.12/cMap texstudio.app/Contents/share/poppler
cp -r poppler-data-0.4.12/nameToUnicode texstudio.app/Contents/share/poppler
cp -r poppler-data-0.4.12/unicodeMap texstudio.app/Contents/share/poppler
- name: Package
id: package
run: |
cd build
/usr/local/QtBase-${{ env.OSX_QT_VERSION }}-Darwin/bin/macdeployqt texstudio.app -dmg
. ../.github/scripts/get-version.sh
cp texstudio.dmg ../texstudio-${GIT_VERSION}-osx.dmg
mv texstudio.dmg ../texstudio-osx-${VERSION_NAME}.dmg
echo "VERSION_NAME=${VERSION_NAME}" >> $GITHUB_OUTPUT
echo "TXS_VERSION=${TXS_VERSION}" >> $GITHUB_OUTPUT
echo "GIT_VERSION=${GIT_VERSION}" >> $GITHUB_OUTPUT
- name: Upload to Github artifacts
if: github.event_name == 'push'
uses: actions/upload-artifact@v4
with:
name: texstudio-osx
path: texstudio-osx-${{ steps.package.outputs.VERSION_NAME }}.dmg
- name: Upload release file(s)
uses: actions/upload-artifact@v4
if: startsWith(github.ref, 'refs/tags/')
with:
name: release-osx
path: texstudio-${{ steps.package.outputs.GIT_VERSION }}-osx.dmg
macosxM1:
name: Mac OS X (M1)
if: true
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch tag annotations
run: git fetch --tags --force
- name: Install Dependencies
run: |
wget https://github.com/sunderme/homebrew-qt6-modules/releases/download/${{ env.OSX_QT_VERSION }}/QtBase-${{ env.OSX_QT_VERSION }}-Darwin-M1.tar.xz
sudo tar xvf ./QtBase-${{ env.OSX_QT_VERSION }}-Darwin-M1.tar.xz -C /usr/local
rm QtBase-${{ env.OSX_QT_VERSION }}-Darwin-M1.tar.xz
wget https://github.com/sunderme/homebrew-qt6-modules/releases/download/${{ env.OSX_QT_VERSION }}/QtSvg-${{ env.OSX_QT_VERSION }}-Darwin-M1.tar.xz
sudo tar xvf ./QtSvg-${{ env.OSX_QT_VERSION }}-Darwin-M1.tar.xz -C /usr/local/QtBase-${{ env.OSX_QT_VERSION }}-Darwin --strip-components=1
rm QtSvg-${{ env.OSX_QT_VERSION }}-Darwin-M1.tar.xz
wget https://github.com/sunderme/homebrew-qt6-modules/releases/download/${{ env.OSX_QT_VERSION }}/Qt5Compat-${{ env.OSX_QT_VERSION }}-Darwin-M1.tar.xz
sudo tar xvf ./Qt5Compat-${{ env.OSX_QT_VERSION }}-Darwin-M1.tar.xz -C /usr/local/QtBase-${{ env.OSX_QT_VERSION }}-Darwin --strip-components=1
rm Qt5Compat-${{ env.OSX_QT_VERSION }}-Darwin-M1.tar.xz
wget https://github.com/sunderme/homebrew-qt6-modules/releases/download/${{ env.OSX_QT_VERSION }}/QtTools-${{ env.OSX_QT_VERSION }}-Darwin-M1.tar.xz
sudo tar xvf ./QtTools-${{ env.OSX_QT_VERSION }}-Darwin-M1.tar.xz -C /usr/local/QtBase-${{ env.OSX_QT_VERSION }}-Darwin --strip-components=1
rm QtTools-${{ env.OSX_QT_VERSION }}-Darwin-M1.tar.xz
wget https://github.com/sunderme/homebrew-qt6-modules/releases/download/${{ env.OSX_QT_VERSION }}/QtDeclarative-${{ env.OSX_QT_VERSION }}-Darwin-M1.tar.xz
sudo tar xvf ./QtDeclarative-${{ env.OSX_QT_VERSION }}-Darwin-M1.tar.xz -C /usr/local/QtBase-${{ env.OSX_QT_VERSION }}-Darwin --strip-components=1
rm QtDeclarative-${{ env.OSX_QT_VERSION }}-Darwin-M1.tar.xz
wget https://github.com/sunderme/homebrew-qt6-modules/releases/download/${{ env.OSX_QT_VERSION }}/poppler-${{ env.OSX_POPPLER_VERSION }}-Darwin-M1.tar.xz
sudo tar xvf ./poppler-${{ env.OSX_POPPLER_VERSION}}-Darwin-M1.tar.xz -C /usr/local --strip-components=1
rm poppler-${{ env.OSX_POPPLER_VERSION }}-Darwin-M1.tar.xz
wget https://github.com/sunderme/homebrew-qt6-modules/releases/download/${{ env.OSX_QT_VERSION }}/QuaZip-${{ env.OSX_QUAZIP_VERSION }}-Darwin-M1.tar.xz
sudo tar xvf ./QuaZip-${{ env.OSX_QUAZIP_VERSION }}-Darwin-M1.tar.xz -C /usr/local --strip-components=1
rm QuaZip-${{ env.OSX_QUAZIP_VERSION }}-Darwin-M1.tar.xz
brew install cairo fontconfig freetype gettext jpeg libpng libtiff little-cms2 openjpeg
brew install ninja pkg-config
- name: Configure
run: |
mkdir build
cd build
/usr/local/QtBase-${{ env.OSX_QT_VERSION }}-Darwin/bin/qt-cmake .. -G Ninja
- name: Build
run: |
cd build
cmake --build . --parallel
- name: Workarounds
run: |
cd build
mkdir -p texstudio.app/Contents/Frameworks
touch texstudio.app/Contents/Resources/empty.lproj
- name: poppler data
run: |
cd build
wget https://poppler.freedesktop.org/poppler-data-0.4.12.tar.gz
tar xvf poppler-data-0.4.12.tar.gz
mkdir -p texstudio.app/Contents/share/poppler
cp -r poppler-data-0.4.12/cidToUnicode texstudio.app/Contents/share/poppler
cp -r poppler-data-0.4.12/cMap texstudio.app/Contents/share/poppler
cp -r poppler-data-0.4.12/nameToUnicode texstudio.app/Contents/share/poppler
cp -r poppler-data-0.4.12/unicodeMap texstudio.app/Contents/share/poppler
- name: Package
id: package
run: |
cd build
# /usr/local/QtBase-${{ env.OSX_QT_VERSION }}-Darwin/bin/macdeployqt texstudio.app -dmg
/usr/local/QtBase-${{ env.OSX_QT_VERSION }}-Darwin/bin/macdeployqt texstudio.app
codesign --force --deep --sign - texstudio.app
. ../.github/scripts/get-version.sh
cp -r texstudio.app ../texstudio-${GIT_VERSION}-osx-m1.app
mkdir ../app
mv texstudio.app ../app/texstudio-osx-m1-${VERSION_NAME}.app
cd ..
# zip -r texstudio-osx-m1-${VERSION_NAME}.zip texstudio-osx-m1-${VERSION_NAME}.app
zip -r texstudio-${GIT_VERSION}-osx-m1.zip texstudio-${GIT_VERSION}-osx-m1.app
echo "VERSION_NAME=${VERSION_NAME}" >> $GITHUB_OUTPUT
echo "TXS_VERSION=${TXS_VERSION}" >> $GITHUB_OUTPUT
echo "GIT_VERSION=${GIT_VERSION}" >> $GITHUB_OUTPUT
- name: Upload to Github artifacts
if: github.event_name == 'push'
uses: actions/upload-artifact@v4
with:
name: texstudio-osx-m1
path: app
# path: texstudio-osx-m1-${{ steps.package.outputs.VERSION_NAME }}.zip
- name: Upload release file(s)
uses: actions/upload-artifact@v4
if: startsWith(github.ref, 'refs/tags/')
with:
name: release-osx-m1
path: texstudio-${{ steps.package.outputs.GIT_VERSION }}-osx-m1.zip
release:
permissions:
actions: write # for GeekyEggo/delete-artifact to delete artifacts
contents: write # for softprops/action-gh-release to create GitHub release
name: Release
needs: [build-win10, build-linux-release, macosx, macosxM1] # build-linux-win,macosx-qt5 is disabled
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download temp artifacts
uses: actions/download-artifact@v4
with:
pattern: release-*
merge-multiple: true
- name: Calculate hashes
run: |
echo --SHA1SUM-- > hashes.txt
sha1sum * | grep -v hashes.txt >> hashes.txt
echo >> hashes.txt
echo --SHA256SUM-- >> hashes.txt
sha256sum * | grep -v hashes.txt >> hashes.txt
- name: Batch release
uses: softprops/action-gh-release@v2
with:
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }}
files: ./*
- name: Delete temp artifacts
uses: GeekyEggo/delete-artifact@v5
with:
name: release-*