-
Notifications
You must be signed in to change notification settings - Fork 6
211 lines (184 loc) · 7.02 KB
/
mac_build.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
name: 🍎 macOS Builds
on:
push:
branches:
- 'main'
pull_request:
jobs:
extract-sdk:
runs-on: "macos-12"
name: Extract SDK
steps:
- name: "Load cache"
uses: actions/cache@v3
id: "cache"
with:
path: ~/cached_builds/sdk
key: MacOS-sdk
continue-on-error: true
- name: "Checkout osxcross"
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: tpoechtrager/osxcross
- name: "Extract SDK"
if: steps.cache.outputs.cache-hit != 'true'
run: |
#ls /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
#sed 's/\^MacOSX13\.\*|//g' tools/gen_sdk_package.sh > tools/gen_sdk_package.sh.patched
#mv tools/gen_sdk_package.sh.patched tools/gen_sdk_package.sh
#chmod +x tools/gen_sdk_package.sh
XCODEDIR=/Applications/Xcode_14.0.1.app ./tools/gen_sdk_package.sh
mkdir -p -v ~/cached_builds/sdk
mv MacOSX12.3.sdk.tar.xz ~/cached_builds/sdk
compile-ffmpeg:
needs: extract-sdk
runs-on: "ubuntu-20.04"
name: Compile FFMPEG
steps:
- name: "Load cache (SDK)"
uses: actions/cache@v3
id: "cache-sdk"
with:
path: ~/cached_builds/sdk
key: MacOS-sdk
continue-on-error: false
- name: "Load cache (videodecoder)"
uses: actions/cache@v3
id: "cache-videodecoder"
with:
path: cached_builds/videodecoder/macos
key: MacOS-videodecoder-build
continue-on-error: true
- name: "Checkout godot-videodecoder"
if: steps.cache-videodecoder.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: retrohub-org/godot-videodecoder
submodules: recursive
- name: "Compile"
if: steps.cache-videodecoder.outputs.cache-hit != 'true'
env:
PLATFORMS: macos
run: |
mv ~/cached_builds/sdk/MacOSX12.3.sdk.tar.xz darwin_sdk
./build_gdextension.sh
mkdir -p -v cached_builds/videodecoder
cp -r -v target/* cached_builds/videodecoder
build-macos:
needs: compile-ffmpeg
runs-on: "macos-12"
name: Build
steps:
- name: "Checkout RetroHub"
uses: actions/checkout@v3
with:
path: "retrohub"
- name: "Load cached objects (Godot editor)"
uses: actions/cache@v3
id: "cache_editor"
with:
path: cached_builds/editor/Godot.app
key: MacOS-editor-build
continue-on-error: true
- name: "Load cached objects (Godot templates)"
uses: actions/cache@v3
id: "cache_template"
with:
path: cached_builds/template/macos.zip
key: MacOS-template-build
continue-on-error: true
- name: "Load cached objects (Videodecoder)"
uses: actions/cache@v3
id: "cache_videodecoder"
with:
path: cached_builds/videodecoder/macos
key: MacOS-videodecoder-build
continue-on-error: false
- name: "Checkout Custom Godot"
if: steps.cache_template.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: retrohub-org/godot
ref: retrohub_patches_4x
path: "godot"
- name: "[Godot] Dependencies"
if: steps.cache_template.outputs.cache-hit != 'true'
working-directory: ./godot
shell: bash
run: |
brew install scons yasm
- name: "[Godot] Setup Godot build cache"
if: steps.cache_template.outputs.cache-hit != 'true'
uses: ./godot/.github/actions/godot-cache
with:
cache-name: macos-template
continue-on-error: true
- name: "[Godot] Setup python and scons"
if: steps.cache_template.outputs.cache-hit != 'true'
uses: ./godot/.github/actions/godot-deps
- name: "[Godot] Setup Vulkan SDK"
if: steps.cache_template.outputs.cache-hit != 'true'
run: |
sh godot/misc/scripts/install_vulkan_sdk_macos.sh
- name: "[Godot] Compilation [template] (x86_64)"
if: steps.cache_template.outputs.cache-hit != 'true'
uses: ./godot/.github/actions/godot-build
with:
root: ./godot
sconsflags: verbose=yes warnings=all werror=yes use_lto=yes optimize=size arch=x86_64
platform: macos
target: template_release
tools: false
- name: "[Godot] Compilation [template] (arm64)"
if: steps.cache_template.outputs.cache-hit != 'true'
uses: ./godot/.github/actions/godot-build
with:
root: ./godot
sconsflags: verbose=yes warnings=all werror=yes use_lto=yes optimize=size arch=arm64
platform: macos
target: template_release
tools: false
- name: "[Godot] Clean and cache template build"
if: steps.cache_template.outputs.cache-hit != 'true'
working-directory: godot
run: |
lipo -create bin/godot.macos.template_release.x86_64 bin/godot.macos.template_release.arm64 -output bin/godot.macos.template_release.universal
cp -r misc/dist/macos_template.app .
mkdir -p -v macos_template.app/Contents/MacOS
cp bin/godot.macos.template_release.universal macos_template.app/Contents/MacOS/godot_macos_release.universal
chmod +x macos_template.app/Contents/MacOS/godot_macos_release.universal
zip -q -9 -r macos.zip macos_template.app
mkdir -p -v ../cached_builds/template
mv macos.zip ../cached_builds/template
- name: "[Godot] Download editor"
if: steps.cache_editor.outputs.cache-hit != 'true'
run: |
wget https://downloads.tuxfamily.org/godotengine/4.1/Godot_v4.1-stable_macos.universal.zip
unzip Godot_v4.1-stable_macos.universal.zip
mkdir -p -v cached_builds/editor
mv Godot.app cached_builds/editor/
- name: "Setup templates and libraries"
env:
TEMPLATE_PATH: /Users/runner/Library/Application Support/Godot/export_templates/4.1.stable
run: |
mkdir -p -v "$TEMPLATE_PATH"
cp cached_builds/template/macos.zip "$TEMPLATE_PATH"
ln -s ../../../cached_builds/videodecoder/macos retrohub/addons/godot-videodecoder/macos
mkdir -p -v export/macos
- name: "Package default themes"
uses: ./retrohub/.github/actions/get-default-themes
- name: "Exporting RetroHub"
working-directory: retrohub
run: |
../cached_builds/editor/Godot.app/Contents/MacOS/Godot --headless --export-release "macOS" ../export/macos/RetroHub.app
- name: "Sign executable"
working-directory: export/macos
run: |
xattr -dr com.apple.quarantine "RetroHub.app"
codesign -s - --force --deep "RetroHub.app"
- name: "Upload Artifacts"
uses: actions/upload-artifact@v3
with:
name: macos
path: export/macos