-
-
Notifications
You must be signed in to change notification settings - Fork 256
162 lines (137 loc) · 5.67 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
name: 🍎 macOS Builds
on:
push:
branches: [master, github_actions, "1.2"]
pull_request:
branches: [master]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Global Cache Settings
env:
SCONS_CACHE_LIMIT: 4096
jobs:
build:
# macOS with latest image
runs-on: "macos-latest"
name: ${{matrix.name}} ${{matrix.arch}}
strategy:
matrix:
arch: [x86_64, arm64]
target: [editor, template_release]
include:
- name: 4.3 Editor
target: editor
executable_name: godot.macos.editor
godot_base_branch: "4.3-stable"
- name: 4.3 Template
target: template_release
executable_name: godot.macos.template_release
godot_base_branch: "4.3-stable"
steps:
# Clone Godot
- uses: actions/checkout@v4
with:
repository: godotengine/godot
ref: ${{ matrix.godot_base_branch }}
# Clone our module under the correct directory
- uses: actions/checkout@v4
with:
path: modules/voxel
# Upload cache on completion and check it out now
- name: Load .scons_cache directory
id: macos-cache
uses: actions/cache@v4
with:
path: ${{github.workspace}}/.scons_cache/
key: ${{matrix.executable_name}}-${{matrix.arch}}-${{matrix.godot_base_branch}}-${{github.ref}}-${{github.sha}}
restore-keys: |
${{matrix.executable_name}}-${{matrix.arch}}-${{matrix.godot_base_branch}}-${{github.ref}}-${{github.sha}}
${{matrix.executable_name}}-${{matrix.arch}}-${{matrix.godot_base_branch}}-${{github.ref}}
${{matrix.executable_name}}-${{matrix.arch}}-${{matrix.godot_base_branch}}
# Use python 3.x release (works cross platform; best to keep self contained in it's own step)
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
# Setup scons, print python version and scons version info, so if anything is broken it won't run the build.
- name: Configuring Python packages
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons
python --version
scons --version
# macOS builds depend on Vulkan SDK
- name: Setup Vulkan SDK
run: |
sh misc/scripts/install_vulkan_sdk_macos.sh
# We should always be explicit with our flags usage here since it's gonna be sure to always set those flags
- name: Compilation
env:
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
run: |
scons arch=${{matrix.arch}} verbose=yes warnings=extra werror=yes platform=macos tests=no target=${{matrix.target}} dev_build=no production=yes
# Make build available
- uses: actions/upload-artifact@v4
with:
name: ${{matrix.executable_name}}.${{matrix.arch}}
path: bin/${{matrix.executable_name}}.${{matrix.arch}}
create-universal-binaries:
needs: [build]
runs-on: "macos-latest"
name: Create universal library bundles
strategy:
matrix:
executable_name: [godot.macos.editor, godot.macos.template_release]
steps:
- uses: actions/download-artifact@v4
with:
pattern: ${{matrix.executable_name}}.*
merge-multiple: true
path: bin
# Create universal binary
- name: Lipo bundle
run: |
lipo -create bin/${{matrix.executable_name}}.x86_64 bin/${{matrix.executable_name}}.arm64 -output bin/${{matrix.executable_name}}.universal
- uses: actions/upload-artifact@v4
with:
name: ${{matrix.executable_name}}.universal
path: bin/${{matrix.executable_name}}.universal
create-app-bundles:
needs: [create-universal-binaries]
runs-on: "macos-latest"
steps:
- uses: actions/checkout@v4
with:
repository: godotengine/godot
ref: "4.3-stable"
- uses: actions/download-artifact@v4
with:
pattern: godot.macos.*.universal
merge-multiple: true
path: bin
# Use `ditto` # macos specific archiver to workaround https://github.com/actions/upload-artifact/issues/38
- name: Create editor .app bundle
run: |
cp -r misc/dist/macos_tools.app ./godot.macos.editor.app
mkdir -p godot.macos.editor.app/Contents/MacOS
cp bin/godot.macos.editor.universal godot.macos.editor.app/Contents/MacOS/Godot
chmod +x godot.macos.editor.app/Contents/MacOS/Godot
codesign --force --timestamp --options=runtime --entitlements misc/dist/macos/editor.entitlements -s - godot.macos.editor.app
ditto -c -k --sequesterRsrc --keepParent godot.macos.editor.app godot.macos.editor.app.zip
- name: Create macos template
run: |
cp -r misc/dist/macos_template.app ./godot.macos.template.app
mkdir -p godot.macos.template.app/Contents/MacOS
cp bin/godot.macos.template_release.universal godot.macos.template.app/Contents/MacOS/godot_macos_release.universal
chmod +x godot.macos.template.app/Contents/MacOS/godot_macos*
ditto -c -k --sequesterRsrc --keepParent godot.macos.template.app godot.macos.template.app.zip
- uses: actions/upload-artifact@v4
with:
name: godot.macos.editor.app
path: godot.macos.editor.app.zip
- uses: actions/upload-artifact@v4
with:
name: godot.macos.template.app
path: godot.macos.template.app.zip