forked from arch1t3cht/Aegisub
-
Notifications
You must be signed in to change notification settings - Fork 1
188 lines (166 loc) · 5.77 KB
/
macos.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
name: macOS Build & Package
on:
push:
branches:
- master
- feature
- cibuilds
paths:
- '**'
- '!.github/workflows/**'
- '.github/workflows/macos.yml'
- '!docs/**'
- '!packages/**'
- 'packages/meson.build'
- 'packages/desktop/**'
- '!packages/desktop/aegisub.appdata**'
- '!packages/desktop/aegisub.desktop**'
- 'packages/osx_**'
- '!tools/win-installer-**'
pull_request:
branches:
- master
- feature
paths:
- '**'
- '!.github/workflows/**'
- '.github/workflows/macos.yml'
- '!docs/**'
- '!packages/**'
- 'packages/meson.build'
- 'packages/desktop/**'
- '!packages/desktop/aegisub.appdata**'
- '!packages/desktop/aegisub.desktop**'
- 'packages/osx_**'
- '!tools/win-installer-**'
workflow_dispatch:
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-12, macos-13, macos-14]
wxver: [3.2, 3.3]
include:
- buildtype: release
- base-args: >-
-Ddefault_library=static
-Dbuild_osx_bundle=true
-Dbestsource=enabled
-Dvapoursynth=enabled
--force-fallback-for=ffms2
- os: macos-12
pref: "/usr/local"
prefix: "/usr/local/opt"
- os: macos-13
pref: "/usr/local"
prefix: "/usr/local/opt"
- os: macos-14
pref: "/opt/homebrew"
prefix: "/opt/homebrew/opt"
- wxver: 3.2
extra-args: ''
- wxver: 3.3
extra-args: "-Dwx_version='3.3.0'"
- name: x86-64 Release (macOS 12)
os: macos-12
wxver: 3.2
- name: x86-64 Release (macOS 13)
os: macos-13
wxver: 3.2
- name: arm64 Release
os: macos-14
wxver: 3.2
- name: x86-64 Release (macOS 12, wx master)
os: macos-12
wxver: 3.3
- name: x86-64 Release (macOS 13, wx master)
os: macos-13
wxver: 3.3
- name: arm64 Release (wx master)
os: macos-14
wxver: 3.3
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout BestSource repo
uses: actions/checkout@v4
with:
repository: vapoursynth/bestsource
ref: R5
path: subprojects/bestsource
submodules: recursive
- name: Checkout wxWidgets repo (3.2 release)
if: matrix.wxver == 3.2
uses: actions/checkout@v4
with:
repository: wxWidgets/wxWidgets
ref: v3.2.5
path: subprojects/wxWidgets
submodules: recursive
- name: Checkout wxWidgets repo (master branch)
if: matrix.wxver == 3.3
uses: actions/checkout@v4
with:
repository: wxWidgets/wxWidgets
ref: master
path: subprojects/wxWidgets-master
submodules: recursive
- uses: actions/setup-python@v5
with:
python-version: '3.x'
# copied from gha workflow in meson repo
# github actions overwrites brew's python. Force it to reassert itself, by running in a separate step.
- name: Unbreak Python in GitHub Actions
run: |
brew update
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
sudo rm -rf /Library/Frameworks/Python.framework/
brew install --force python3 && brew unlink python3 && brew unlink python3 && brew link --overwrite python3
- name: Setup Meson
run: pipx install meson
- name: Install dependencies
run: |
brew install luarocks
sudo luarocks install moonscript --dev
brew install ninja nasm boost libass
brew install --HEAD ffms2
brew install zlib fftw hunspell
brew install pulseaudio # NO OpenAL in github CI
brew install libpng
- name: set up MacOS env
run: |
# Changes are only available in the following steps, not the current one
# echo 'CPPFLAGS=-I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I${{matrix.prefix}}/gettext/include' >> $GITHUB_ENV
echo 'CPPFLAGS=-I${{matrix.pref}}/include -I${{matrix.prefix}}/icu4c/include -I${{matrix.prefix}}/gettext/include' >> $GITHUB_ENV
echo 'LDFLAGS=-L${{matrix.prefix}}/gettext/lib' >> $GITHUB_ENV
echo 'PKG_CONFIG_PATH=${{matrix.prefix}}/icu4c/lib/pkgconfig' >> $GITHUB_ENV
echo 'ACLOCAL_PATH=${{matrix.prefix}}/gettext/share/aclocal' >> $GITHUB_ENV
# Prepend to $PATH
echo "${{matrix.prefix}}/icu4c/bin" >> $GITHUB_PATH
echo "${{matrix.prefix}}/icu4c/sbin" >> $GITHUB_PATH
echo "${{matrix.prefix}}/gettext/bin" >> $GITHUB_PATH
- name: Configure
run: |
meson setup build ${{ matrix.base-args }} ${{ matrix.extra-args }} -Dbuildtype=${{ matrix.buildtype }}
meson configure build
- name: Build
run: meson compile -C build
- name: Run test
run: meson test -C build --verbose "gtest main"
# macOS artifacts
- name: Generate macOS bundle
run: meson compile osx-bundle -C build
- name: Sign the app bundle
run: codesign --sign - --force --deep build/Aegisub.app
- name: Generate macOS app dmg
run: meson compile osx-build-dmg -C build
- name: Upload artifacts - macOS dmg
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }} - installer
path: build/Aegisub-*.dmg
if-no-files-found: error