-
Notifications
You must be signed in to change notification settings - Fork 127
266 lines (228 loc) · 8.9 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
name: CD
on:
push:
pull_request:
schedule:
- cron: '42 2 1 * *'
workflow_dispatch:
jobs:
ubuntu:
name: Ubuntu (Launchpad)
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch the entire history so we can create the changelog
- name: Package for Launchpad
id: package
uses: ./.github/actions/package-launchpad
with:
DEB_PASSPHRASE: ${{ secrets.DEB_PASSPHRASE }}
DECRYPTION_KEY: ${{ secrets.DECRYPTION_KEY }}
- name: Deploy to Launchpad
uses: ./.github/actions/deploy-launchpad
with:
changes_files: ${{ steps.package.outputs.changes_files }}
devel-repo: "ppa:texworks/ppa"
stable-repo: "ppa:texworks/stable"
################################################################################
appimage:
name: Linux/AppImage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: DOCKER_BUILDKIT=1 docker build -f ./.github/workflows/Dockerfile.appimage-debian -o out .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: TeXworks-AppImage
path: out/TeXworks-*.AppImage
################################################################################
win:
name: Windows
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
winVersion: [7, 10]
include:
# Latest Qt6 release [https://download.qt.io/official_releases/qt/]
# Qt 6.6 supports Windows >= 10 [https://doc.qt.io/qt-6/windows.html]
- winVersion: 10
qtVersionMajor: 6
additionalLibs: 'zstd;z'
# Qt 5.15 supports Windows >= 7 [https://doc.qt.io/qt-5/windows.html]
- winVersion: 7
qtVersionMajor: 5
additionalLibs: ''
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup WSL
uses: Vampire/setup-wsl@v3
with:
distribution: Ubuntu-22.04
- name: Install dependencies
uses: ./.github/actions/setup-windows
with:
qt: ${{ matrix.qtVersionMajor }}
- name: Strip libraries
shell: wsl-bash {0}
if: matrix.qtVersionMajor == 6
run: |
# Work around https://github.com/microsoft/WSL/issues/3023
strip --remove-section=.note.ABI-tag /usr/lib/mxe/usr/x86_64-pc-linux-gnu/qt6/lib/*.so.*
- name: Configure
shell: wsl-bash {0}
# ./release is where Inno Setup looks for distribution files
run: |
/usr/lib/mxe/usr/bin/i686-w64-mingw32.static-cmake -B build -DTW_BUILD_ID='github' \
-DQT_DEFAULT_MAJOR_VERSION=${{ matrix.qtVersionMajor }} \
-DCMAKE_INSTALL_PREFIX="./release" \
-DPLATFORM_DEPENDENCIES='freetype;harfbuzz;freetype_too;bz2;iphlpapi;ssl;crypto;crypt32;ws2_32;sharpyuv' \
-DPoppler_ADDITIONAL_DEPENDENCIES='freetype;harfbuzz;freetype_too;glib-2.0;intl;iconv;ws2_32;winmm;tiff;webp;jpeg;openjp2;png;lcms2;lzma;bz2;pcre16;wtsapi32;sharpyuv;${{ matrix.additionalLibs }}' \
-DTEXWORKS_ADDITIONAL_LIBS='freetype;harfbuzz;freetype_too;bz2;wtsapi32;opengl32;imm32;shlwapi;dwmapi;uxtheme' \
-Dgp_tool='none'
- name: Build
shell: wsl-bash {0}
run: /usr/lib/mxe/usr/bin/i686-w64-mingw32.static-cmake --build build -v && /usr/lib/mxe/usr/bin/i686-w64-mingw32.static-cmake --install build -v
- name: Prepare testing
shell: wsl-bash {0}
run: |
echo "::group::Fixup CTest files"
SRC=$(pwd)
DST=$(echo "${{ github.workspace }}" | tr '\\' '/')
cd build
for FILE in $(find . -name CTestTestfile.cmake); do
echo "Fixing $FILE"
sed -ie "s|${SRC}|${DST}|g" "$FILE"
done
echo "::endgroup::"
- name: Test
run: ctest -V
working-directory: build
env:
QT_FORCE_STDERR_LOGGING: 1
- name: Package
uses: ./.github/actions/package-windows
id: package
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: TeXworks-Windows${{ matrix.winVersion }}
path: ${{ steps.package.outputs.file }}
- name: Build installer
run: ISCC texworks-setup-script.iss
working-directory: win32
- name: Upload installer artifact
uses: actions/upload-artifact@v4
with:
name: TeXworks-Windows${{ matrix.winVersion }}-Setup
path: win32/Output/*.exe
# - name: Deploy to Artifactory
# if: github.event_name == 'push'
# uses: ./.github/actions/deploy-artifactory
# with:
# file: ${{ steps.package.outputs.file }}
# baseurl: https://texworks.jfrog.io
# repo: windows-latest
# remotePath: ${{ steps.package.outputs.version }}
# username: [email protected]
# key: ${{ secrets.jfrog_key }}
################################################################################
macosx:
name: Mac OS X
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
label: [11-x86, 11-arm, 10.13-x86]
include:
# Latest open-source LTS Qt6 release [https://download.qt.io/official_releases/qt/]
# Qt 6.5 supports macOS >= 11 [https://doc.qt.io/qt-6.5/macos.html]
- label: 11-x86
macVersion: 11
qtVersionMajor: 6
qtVersion: 6.5.3
qtModules: qt5compat
arch: x86_64
- label: 11-arm
macVersion: 11
qtVersionMajor: 6
qtVersion: 6.5.3
qtModules: qt5compat
arch: arm64
# Qt 5.15 supports macOS >= 10.13 [https://doc.qt.io/qt-5.15/macos.html]
# poppler >= 22.01.0 uses std::filesystem, which seems to only be (fully)
# supported on macOS 10.15 and up
- label: 10.13-x86
macVersion: 10.13
qtVersionMajor: 5
qtVersion: 5.15.2
qtModules: qtscript
arch: x86_64
env:
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macVersion }}
steps:
- name: Checkout
uses: actions/checkout@v4
# Mono seems to provide some (potentially incompatible) headers that CMake
# might pick up on instead of ours
- name: Uninstall Mono
run: sudo /bin/sh -c "$(curl -fsSL https://github.com/gurza/cli-toolbox/raw/master/uninstall-apps/uninstall-mono.sh)"
- name: Install clean Homebrew dependencies
shell: bash
run: |
# Uninstall all packages
brew remove --force $(brew list --formula)
brew remove --cask --force $(brew list)
# Update Homebrew
brew update > brew_update.log || { echo "::error::Updating homebrew failed"; cat brew_update.log; exit 1; }
# Install needed dependencies
brew install automake cmake libtool pkg-config
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qtVersion }}
modules: ${{ matrix.qtModules }}
- name: Cache dependencies
id: cache-dependencies
uses: actions/cache@v4
with:
key: twdeps-${{ runner.os }}-${{ env.MACOSX_DEPLOYMENT_TARGET }}-${{ matrix.arch }}-qt${{ matrix.qtVersion }}-${{ hashFiles('./.github/actions/setup-macos/*') }}
path: ${{ runner.temp }}/tw-deps
- name: Build dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
shell: bash
run: |
cmake -S ".github/actions/setup-macos" -B ".github/actions/setup-macos/build" -DCMAKE_INSTALL_PREFIX="${RUNNER_TEMP}/tw-deps" -DQT_DEFAULT_MAJOR_VERSION=${{ matrix.qtVersionMajor }} -DCMAKE_OSX_ARCHITECTURES="${{ matrix.arch }}"
PATH="${RUNNER_TEMP}/tw-deps/bin:$PATH" PKG_CONFIG_PATH=${RUNNER_TEMP}/tw-deps/lib/pkgconfig cmake --build ".github/actions/setup-macos/build" -v
- name: Configure
run: cmake -B build -DTW_BUILD_ID='github' ${GITHUB_WORKSPACE} -DCMAKE_PREFIX_PATH="${RUNNER_TEMP}/tw-deps" -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE -DQT_DEFAULT_MAJOR_VERSION=${{ matrix.qtVersionMajor }} -DCMAKE_OSX_ARCHITECTURES="${{ matrix.arch }}" -DQT_PLUGIN_PATH=${QT_PLUGIN_PATH}
- name: Build
run: cmake --build build -j
- name: Test
run: ctest -V
working-directory: build
- name: Package
id: package
uses: ./.github/actions/package-macos
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: TeXworks-macOS${{ matrix.macVersion }}-${{ matrix.arch }}
path: ${{ steps.package.outputs.file }}
# - name: Deploy to Artifactory
# if: github.event_name == 'push'
# uses: ./.github/actions/deploy-artifactory
# with:
# file: ${{ steps.package.outputs.file }}
# baseurl: https://texworks.jfrog.io
# repo: macos-latest
# remotePath: ${{ steps.package.outputs.version }}
# username: [email protected]
# key: ${{ secrets.jfrog_key }}