-
Notifications
You must be signed in to change notification settings - Fork 111
140 lines (124 loc) · 4.73 KB
/
macos_builds_deployment.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
name: 🍎 macOS Builds
on:
push:
paths:
- godot-engine/**
- .github/**
defaults:
run:
working-directory: ./godot-engine
# Global Settings
env:
# Used for the cache key. Add version suffix to force clean build.
GODOT_BASE_BRANCH: master
SCONSFLAGS: verbose=yes warnings=extra werror=no module_text_server_fb_enabled=yes fontconfig=no use_volk=no
concurrency:
# workflow name - PR || fallback to unique run id, this happens when you're not building a PR
# this ensures all branches build properly and cancel their previous runs
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-macos:
runs-on: "macos-latest"
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: Editor
cache-name: macos-editor
target: editor
tests: false
strip: true
sconsflags: debug_symbols=no optimize=speed production=yes
dist-app: "macos_tools.app"
packaged-app: "MirrorGodotEditorMac.app"
bin-name: "godot.macos.editor.universal"
bin-name-x86_64: "godot.macos.editor.x86_64"
bin-name-arm64: "godot.macos.editor.arm64"
artifact-bin-name: "Godot"
artifact-name: "MirrorGodotEditorMac.app"
- name: Template
cache-name: macos-template
target: template_debug
tests: false
strip: true
sconsflags: debug_symbols=no optimize=speed
dist-app: "macos_template.app"
packaged-app: "macos_template.app"
bin-name: "godot.macos.template_debug.universal"
bin-name-x86_64: "godot.macos.template_debug.x86_64"
bin-name-arm64: "godot.macos.template_debug.arm64"
artifact-bin-name: "godot_macos_release.universal"
artifact-name: "macos_template.app"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup python and scons
uses: ./godot-engine/.github/actions/godot-deps
- name: Setup Vulkan SDK
run: |
# Download and install the Vulkan SDK.
curl -L "https://sdk.lunarg.com/sdk/download/latest/mac/vulkan-sdk.dmg" -o /tmp/vulkan-sdk.dmg
hdiutil attach /tmp/vulkan-sdk.dmg -mountpoint /Volumes/vulkan-sdk
/Volumes/vulkan-sdk/InstallVulkan.app/Contents/MacOS/InstallVulkan \
--accept-licenses --default-answer --confirm-command install
- name: Setup Godot build cache
uses: ./godot-engine/.github/actions/godot-cache
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
- name: Setup scons (python is already installed on self-hosted runners!)
shell: bash
run: |
python3 -c "import sys; print(sys.version)"
python3 -m ensurepip --upgrade
python3 -m pip install --user scons
scons --version
- name: Setup cmake
shell: bash
run: |
brew install cmake
cmake --version
- name: Remove existing binaries
run: |
rm -Rf bin/
- name: Compilation (x86_64)
uses: ./.github/actions/godot-build
with:
sconsflags: ${{ env.SCONSFLAGS }} arch=x86_64
platform: macos
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}
- name: Compilation (arm64)
uses: ./.github/actions/godot-build
with:
sconsflags: ${{ env.SCONSFLAGS }} arch=arm64
platform: macos
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}
- name: Strip binaries
if: ${{ matrix.strip }}
run: |
echo "Stripping binaries"
strip bin/*
- name: Prepare universal executable
run: |
lipo -create bin/${{ matrix.bin-name-x86_64 }} bin/${{ matrix.bin-name-arm64 }} -output bin/${{ matrix.bin-name }}
chmod -R +x bin/*
- name: Package in macOS app bundle
shell: sh
run: |
cp -R misc/dist/${{ matrix.dist-app }} bin/${{ matrix.packaged-app }}
cd bin/
mkdir -p ${{ matrix.packaged-app }}/Contents/MacOS
cp ${{ matrix.bin-name }} ${{ matrix.packaged-app }}/Contents/MacOS/${{ matrix.artifact-bin-name }}
chmod -R +x ${{ matrix.packaged-app }}
xattr -rc ${{ matrix.packaged-app }}
zip -q -9 -r ${{ matrix.artifact-name }}.zip ${{ matrix.packaged-app }}
- name: Upload artifact
uses: ./.github/actions/upload-artifact
with:
name: "${{ matrix.artifact-name }}.zip"
path: "./godot-engine/bin/${{ matrix.artifact-name }}.zip"