-
Notifications
You must be signed in to change notification settings - Fork 641
309 lines (275 loc) · 11.9 KB
/
Copy pathci.yml
File metadata and controls
309 lines (275 loc) · 11.9 KB
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
name: Meson CI
on:
push:
branches: [ master ]
tags: [ 'v*' ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
env:
# Pull request checkouts use a detached merge commit. Preserve the source
# branch in generated non-release version and artifact names.
AEGISUB_BUILD_BRANCH: ${{ github.head_ref || github.ref_name }}
strategy:
fail-fast: false
matrix:
config:
- name: Windows MSVC Release
os: windows-latest
msvc: true
devenv: |
Import-Module "$env:VS\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
Enter-VsDevShell -VsInstallPath $env:VS -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64"
buildtype: release
args: >-
-Ddefault_library=static
--force-fallback-for=zlib,harfbuzz,freetype2,fribidi
-Dfallback_nasm=true
-Dfreetype2:harfbuzz=disabled
-Dharfbuzz:freetype=disabled
-Dharfbuzz:cairo=disabled
-Dharfbuzz:glib=disabled
-Dharfbuzz:gobject=disabled
-Dharfbuzz:tests=disabled
-Dharfbuzz:docs=disabled
-Dfribidi:tests=false
-Dfribidi:docs=false
-Dlibass:fontconfig=disabled
#- {
# name: Windows MinGW,
# os: windows-latest,
# msvc: false
#}
- {
name: Ubuntu Debug,
os: ubuntu-latest,
buildtype: debugoptimized,
args: -Db_pch=false
}
- {
name: Ubuntu Release,
os: ubuntu-latest,
buildtype: release,
args: -Db_pch=false
}
- name: macOS x86_64 Debug
os: macos-15-intel
buildtype: debugoptimized
args: &macos_debug_args >-
-Dmacos_deployment_target=15.0
-Dbuild_osx_bundle=false
-Dfftw3=enabled
-Dlibpulse=disabled
-Dopenal=enabled
- name: macOS x86_64 Release
os: macos-15-intel
buildtype: release
args: &macos_release_args >-
-Ddefault_library=static
-Dbuild_osx_bundle=true
-Dfftw3=disabled
-Dlibpulse=disabled
-Dopenal=enabled
-Dlibass:fontconfig=disabled
-Dlibass:libunibreak=disabled
-Dfreetype2:bzip2=disabled
-Dfreetype2:brotli=disabled
-Dfreetype2:hvf=disabled
-Dfribidi:bin=false
-Dfribidi:docs=false
-Dfribidi:tests=false
-Dharfbuzz:gpu=disabled
-Dharfbuzz:raster=disabled
-Dharfbuzz:subset=disabled
-Dharfbuzz:tests=disabled
-Dharfbuzz:utilities=disabled
-Dharfbuzz:vector=disabled
-Dffmpeg:bzlib=disabled
-Dffmpeg:lzma=disabled
-Dffmpeg:programs=disabled
-Dffmpeg:tests=disabled
-Ddav1d:enable_tests=false
-Ddav1d:enable_tools=false
-Dzlib:tests=disabled
--force-fallback-for=boost,wxWidgets,libass,zlib,freetype2,fribidi,harfbuzz,ffms2,libavformat,libavcodec,libswscale,libavutil,libswresample,dav1d,hunspell,uchardet,icu-uc,icu-i18n,libcurl
- name: macOS arm64 Debug
os: macos-15
buildtype: debugoptimized
args: *macos_debug_args
- name: macOS arm64 Release
os: macos-15
buildtype: release
args: *macos_release_args
steps:
- uses: actions/checkout@v6
with:
fetch-depth: '0'
- uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Setup Meson
run: |
python -m pip install --upgrade pip setuptools
pip install meson
# Taken from https://github.com/libass/libass/blob/0.17.5/.github/workflows/meson.yml#L118-L125
- name: Find Visual Studio
if: matrix.config.msvc
run: |
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vsPath = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if (-not $vsPath) { throw "Could not find a Visual Studio installation" }
"VS=$vsPath"
"VS=$vsPath" >> $env:GITHUB_ENV
- name: Install dependencies (Windows)
if: matrix.config.os == 'windows-latest'
run: |
choco install ninja innosetup
$moonscripturl = "https://github.com/leafo/moonscript/releases/download/v0.6.0/moonscript-v0.6.0-windows-x86_64.zip"
mkdir moonscript
Invoke-WebRequest -Uri $moonscripturl -OutFile ".\moonscript\moonscript.zip"
pushd moonscript
7z e moonscript.zip
Get-Location | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
popd
$gettexturl = "https://github.com/mlocati/gettext-iconv-windows/releases/download/v1.0-v1.18-r3/gettext1.0-iconv1.18-static-64.zip"
Invoke-WebRequest -Uri $gettexturl -OutFile ".\gettext.zip"
Expand-Archive ".\gettext.zip" -DestinationPath gettext
pushd gettext/bin
Get-Location | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
popd
- name: Install dependencies (macOS Debug)
if: startsWith(matrix.config.os, 'macos-') && matrix.config.buildtype == 'debugoptimized'
run: |
brew install ninja pkg-config libass boost zlib ffms2 fftw hunspell uchardet icu4c wxwidgets
echo "PKG_CONFIG_PATH=$(brew --prefix icu4c)/lib/pkgconfig:$(brew --prefix zlib)/lib/pkgconfig" >> "${GITHUB_ENV}"
- name: Install dependencies (macOS Release)
if: startsWith(matrix.config.os, 'macos-') && matrix.config.buildtype == 'release'
run: |
brew install ninja nasm
- name: Install test dependencies (macOS)
if: startsWith(matrix.config.os, 'macos-')
run: |
# LuaJIT is Lua 5.1 to luarocks.
brew install luajit luarocks
luarocks --lua-dir="$(brew --prefix luajit)" --lua-version=5.1 install busted
- name: Install dependencies (Linux)
if: startsWith(matrix.config.os, 'ubuntu-')
run: |
sudo apt-get update
sudo apt-get install ninja-build build-essential libx11-dev libfreetype6-dev pkg-config libfontconfig1-dev libass-dev libasound2-dev libffms2-dev intltool libboost-all-dev libhunspell-dev libcurl4-openssl-dev libuchardet-dev libgtest-dev libgmock-dev libwxgtk3.2-dev libportal-gtk3-dev
# busted for the automation test suite (LuaJIT is Lua 5.1 to luarocks)
sudo apt-get install -y lua5.1 liblua5.1-0-dev luarocks
sudo luarocks --lua-version=5.1 install busted
- name: Configure
run: |
${{ matrix.config.devenv }}
meson setup build ${{ matrix.config.args }} -Dbuildtype=${{ matrix.config.buildtype }} ${{ github.ref_type == 'tag' && '-Dofficial_release=true' || '' }}
- name: Build FFTW (MacOS)
if: startsWith(matrix.config.os, 'macos-') && matrix.config.buildtype == 'release'
run: |
tools/macos-build-fftw.sh build
meson setup --reconfigure --clearcache build \
-Dpkg_config_path="$PWD/build/fftw-prefix/lib/pkgconfig" \
-Dfftw3=enabled
- name: Build
run: |
${{ matrix.config.devenv }}
meson compile -C build
# The automation suite is registered at configure time only if the
# busted probe succeeds, so make sure it can't silently drop out of CI
- name: Check automation tests are registered
if: ${{ !startsWith(matrix.config.os, 'windows-') }}
run: meson test -C build --list | grep automation
# --suite limits this to our own tests, excluding those of subproject deps
- name: Run test
run: |
${{ matrix.config.devenv }}
meson test -C build --verbose --suite Aegisub
# Windows artifacts
- name: Generate Windows installer
if: matrix.config.os == 'windows-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
${{ matrix.config.devenv }}
meson compile win-installer -C build
- name: Generate Windows portable installer
if: matrix.config.os == 'windows-latest'
run: |
${{ matrix.config.devenv }}
cd build && ninja win-portable
- name: Upload artifacts - win_installer
uses: actions/upload-artifact@v6
if: matrix.config.os == 'windows-latest'
with:
name: ${{ matrix.config.name }} - installer
path: build/Aegisub-*.exe
if-no-files-found: error
- name: Upload artifacts - portable.zip
uses: actions/upload-artifact@v6
if: matrix.config.os == 'windows-latest'
with:
name: ${{ matrix.config.name }} - portable
path: build/Aegisub-*-portable.zip
if-no-files-found: error
# macOS artifacts
- name: Generate macOS installer
if: startsWith(matrix.config.os, 'macos-') && matrix.config.buildtype == 'release'
env:
# CI artifacts are intentionally ad-hoc signed. Release managers must
# explicitly replace this with a Developer ID signature before release.
AEGISUB_BUNDLE_SIGNATURE: '-'
run: |
meson compile osx-bundle -C build
# Run osx-build-dmg but retry up to 10 times if it fails since hdiutil can be unreliable
# See: https://github.com/actions/runner-images/issues/7522
max_tries=10
i=0
until meson compile osx-build-dmg -C build ; do
if [ $i -eq $max_tries ]; then
echo "Error: osx-build-dmg failed after ${max_tries} tries."
exit 1
fi
i=$((i+1))
done
- name: Archive macOS app for local signing
if: startsWith(matrix.config.os, 'macos-') && matrix.config.buildtype == 'release' && (github.ref_type == 'tag' || github.event_name == 'workflow_dispatch')
run: |
package_name="$(tools/osx-package-name.sh build/Aegisub.app)"
ditto -c -k --sequesterRsrc --keepParent build/Aegisub.app "build/${package_name}-signing-input.zip"
- name: Upload macOS local-signing input
uses: actions/upload-artifact@v6
if: startsWith(matrix.config.os, 'macos-') && matrix.config.buildtype == 'release' && (github.ref_type == 'tag' || github.event_name == 'workflow_dispatch')
with:
name: ${{ matrix.config.name }} - local signing input
path: build/Aegisub-*-signing-input.zip
if-no-files-found: error
- name: Upload artifacts - macOS dmg
uses: actions/upload-artifact@v6
if: startsWith(matrix.config.os, 'macos-') && matrix.config.buildtype == 'release'
with:
name: ${{ matrix.config.name }} - ad-hoc installer
path: build/Aegisub-*.dmg
if-no-files-found: error
# Tarball
- name: Generate tarball
if: matrix.config.os == 'ubuntu-latest' && matrix.config.buildtype == 'release'
run: |
set -e
meson dist --include-subprojects -C build
# Make sure the subprojects we need are included
mkdir distcheck
tar -xJf build/meson-dist/*.tar.xz -C distcheck/
test -e distcheck/*/subprojects/luabins/meson.build
test -e distcheck/*/subprojects/LuaJIT*/meson.build
- name: Upload artifacts - tarball
uses: actions/upload-artifact@v6
if: matrix.config.os == 'ubuntu-latest' && matrix.config.buildtype == 'release'
with:
name: Source Tarball
path: build/meson-dist/*.tar.xz
if-no-files-found: error