forked from TypesettingTools/Aegisub
-
Notifications
You must be signed in to change notification settings - Fork 2
239 lines (214 loc) · 8.13 KB
/
ci.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
name: Meson CI
on:
push:
branches:
- master
- feature
- cibuilds
pull_request:
branches:
- master
- feature
workflow_dispatch:
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- name: Windows MSVC Release
os: windows-latest
msvc: true
buildtype: release
args: >-
-Ddefault_library=static
--force-fallback-for=zlib,harfbuzz,freetype2,fribidi,libpng
-Dfreetype2:harfbuzz=disabled
-Dharfbuzz:freetype=disabled
-Dharfbuzz:cairo=disabled
-Dharfbuzz:glib=disabled
-Dharfbuzz:gobject=disabled
-Dharfbuzz:tests=disabled
-Dharfbuzz:docs=disabled
-Dharfbuzz:icu=disabled
-Dfribidi:tests=false
-Dfribidi:docs=false
-Dlibass:fontconfig=disabled
-Dffmpeg:libdav1d=enabled
-Davisynth=enabled
-Dbestsource=enabled
-Dvapoursynth=enabled
- name: Windows MSVC Release (wx master)
os: windows-latest
msvc: true
buildtype: release
args: >-
-Ddefault_library=static
--force-fallback-for=zlib,harfbuzz,freetype2,fribidi,libpng
-Dfreetype2:harfbuzz=disabled
-Dharfbuzz:freetype=disabled
-Dharfbuzz:cairo=disabled
-Dharfbuzz:glib=disabled
-Dharfbuzz:gobject=disabled
-Dharfbuzz:tests=disabled
-Dharfbuzz:docs=disabled
-Dharfbuzz:icu=disabled
-Dfribidi:tests=false
-Dfribidi:docs=false
-Dlibass:fontconfig=disabled
-Dffmpeg:libdav1d=enabled
-Davisynth=enabled
-Dbestsource=enabled
-Dvapoursynth=enabled
-Dwx_version='3.3.0'
#- {
# name: Windows MinGW,
# os: windows-latest,
# msvc: false
#}
- {
name: Ubuntu Debug,
os: ubuntu-latest,
buildtype: debugoptimized,
args: ''
}
- {
name: Ubuntu Release,
os: ubuntu-latest,
buildtype: release,
args: ''
}
- name: Ubuntu AppImage
os: ubuntu-22.04
buildtype: release
appimage: true
# distro ffms is currently broken
args: >-
--prefix=/usr
-Dbuild_appimage=true
-Ddefault_library=static
--force-fallback-for=ffms2
-Dffmpeg:libdav1d=enabled
-Davisynth=enabled
-Dbestsource=enabled
-Dvapoursynth=enabled
- {
name: macOS Release,
os: macos-12,
buildtype: release,
args: -Ddefault_library=static -Dbuild_osx_bundle=true -Dlocal_boost=true -Dvapoursynth=enabled --force-fallback-for=ffms2
}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Setup Meson
run: |
python -m pip install --upgrade pip setuptools
pip install meson
- name: Setup MSVC
if: matrix.config.os == 'windows-latest' && matrix.config.msvc == true
uses: ilammy/msvc-dev-cmd@v1
- name: Install dependencies (Windows)
if: matrix.config.os == 'windows-latest'
run: |
choco install ninja innosetup
$moonscripturl = "https://github.com/leafo/moonscript/releases/download/win32-v0.5.0/moonscript-187bac54ee5a7450013e9c38e005a0e671b76f45.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/v0.21-v1.16/gettext0.21-iconv1.16-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)
if: startsWith(matrix.config.os, 'macos-')
run: |
export HOMEBREW_NO_INSTALL_CLEANUP=1
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
# Skip brew update for now, see https://github.com/actions/setup-python/issues/577
# brew update
brew install luarocks ninja
sudo luarocks install luafilesystem 1.8.0
sudo luarocks install moonscript --dev
brew install libass zlib ffms2 fftw hunspell
brew install pulseaudio # NO OpenAL in github CI
- 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 libwxgtk3.0-gtk3-dev libfreetype6-dev pkg-config libfontconfig1-dev libass-dev libasound2-dev libffms2-dev intltool libboost-all-dev libhunspell-dev libuchardet-dev libpulse-dev libopenal-dev libxxhash-dev nasm
- name: Configure
run: |
meson setup build ${{ matrix.config.args }} -Dbuildtype=${{ matrix.config.buildtype }}
meson configure build
- name: Build
run: meson compile -C build
- name: Run test
run: meson test -C build --verbose "gtest main"
# Windows artifacts
- name: Generate Windows installer
if: matrix.config.os == 'windows-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run:
meson compile win-installer -C build
- name: Generate Windows portable installer
if: matrix.config.os == 'windows-latest'
run: cd build && ninja win-portable
- name: Upload artifacts - win_installer
uses: actions/upload-artifact@v4
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@v4
if: matrix.config.os == 'windows-latest'
with:
name: ${{ matrix.config.name }} - portable
path: build/aegisub-portable-64.zip
# macOS artifacts
- name: Generate macOS installer
if: startsWith(matrix.config.os, 'macos-')
run: |
meson compile osx-bundle -C build
meson compile osx-build-dmg -C build
- name: Upload artifacts - macOS dmg
uses: actions/upload-artifact@v4
if: startsWith(matrix.config.os, 'macos-')
with:
name: ${{ matrix.config.name }} - installer
path: build/Aegisub-*.dmg
if-no-files-found: error
# Linux artifacts (AppImage)
- name: Generate AppImage
if: matrix.config.appimage
run: |
mkdir -p appimage/appdir
meson install -C build --destdir=../appimage/appdir
cd appimage
sudo apt-get install libfuse2
curl -L "https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20220822-1/linuxdeploy-x86_64.AppImage" -o linuxdeploy
curl -L "https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage" -o appimagetool
chmod +x linuxdeploy appimagetool
./linuxdeploy --appdir appdir --desktop-file=appdir/aegisub.desktop
./appimagetool appdir
- name: Upload artifacts - Linux AppImage
uses: actions/upload-artifact@v4
if: matrix.config.appimage
with:
name: ${{ matrix.config.name }}
path: appimage/*.AppImage
if-no-files-found: error