| 1 |
name: 🍎 macOS Builds |
| 2 |
on: |
| 3 |
workflow_call: |
| 4 |
workflow_dispatch: |
| 5 |
|
| 6 |
|
| 7 |
env: |
| 8 |
SCONS_FLAGS: >- |
| 9 |
dev_mode=yes |
| 10 |
module_text_server_fb_enabled=yes |
| 11 |
"accesskit_sdk_path=${{ github.workspace }}/accesskit-c-0.21.2/" |
| 12 |
|
| 13 |
jobs: |
| 14 |
build-macos: |
| 15 |
|
| 16 |
runs-on: macos-latest |
| 17 |
name: ${{ matrix.name }} |
| 18 |
timeout-minutes: 120 |
| 19 |
strategy: |
| 20 |
fail-fast: false |
| 21 |
matrix: |
| 22 |
include: |
| 23 |
- name: Editor (target=editor) |
| 24 |
cache-name: macos-editor |
| 25 |
target: editor |
| 26 |
bin: ./bin/godot.macos.editor.universal |
| 27 |
|
| 28 |
- name: Template (target=template_release) |
| 29 |
cache-name: macos-template |
| 30 |
target: template_release |
| 31 |
scons-flags: debug_symbols=no |
| 32 |
bin: ./bin/godot.macos.template_release.universal |
| 33 |
|
| 34 |
steps: |
| 35 |
- name: Checkout |
| 36 |
uses: actions/checkout@v6 |
| 37 |
with: |
| 38 |
submodules: recursive |
| 39 |
|
| 40 |
|
| 41 |
- name: Select Xcode 26 |
| 42 |
run: sudo xcode-select -s /Applications/Xcode_26.0.1.app |
| 43 |
|
| 44 |
- name: Restore Godot build cache |
| 45 |
uses: ./.github/actions/godot-cache-restore |
| 46 |
with: |
| 47 |
cache-name: ${{ matrix.cache-name }} |
| 48 |
continue-on-error: true |
| 49 |
|
| 50 |
- name: Setup Python and SCons |
| 51 |
uses: ./.github/actions/godot-deps |
| 52 |
|
| 53 |
- name: Download pre-built AccessKit |
| 54 |
uses: dsaltares/[email protected] |
| 55 |
with: |
| 56 |
repo: godotengine/godot-accesskit-c-static |
| 57 |
version: tags/0.21.2 |
| 58 |
file: accesskit-c-0.21.2.zip |
| 59 |
target: accesskit-c-0.21.2/accesskit_c.zip |
| 60 |
|
| 61 |
- name: Extract pre-built AccessKit |
| 62 |
run: unzip -o accesskit-c-0.21.2/accesskit_c.zip |
| 63 |
|
| 64 |
- name: Setup Vulkan SDK |
| 65 |
id: vulkan-sdk |
| 66 |
run: | |
| 67 |
if sh misc/scripts/install_vulkan_sdk_macos.sh; then |
| 68 |
echo "VULKAN_ENABLED=yes" >> "$GITHUB_OUTPUT" |
| 69 |
else |
| 70 |
echo "::warning::macOS: Vulkan SDK installation failed, building without Vulkan support." |
| 71 |
echo "VULKAN_ENABLED=no" >> "$GITHUB_OUTPUT" |
| 72 |
fi |
| 73 |
continue-on-error: true |
| 74 |
|
| 75 |
- name: Compilation (x86_64) |
| 76 |
uses: ./.github/actions/godot-build |
| 77 |
with: |
| 78 |
scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.scons-flags }} arch=x86_64 vulkan=${{ steps.vulkan-sdk.outputs.VULKAN_ENABLED }} |
| 79 |
platform: macos |
| 80 |
target: ${{ matrix.target }} |
| 81 |
|
| 82 |
- name: Compilation (arm64) |
| 83 |
uses: ./.github/actions/godot-build |
| 84 |
with: |
| 85 |
scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.scons-flags }} arch=arm64 vulkan=${{ steps.vulkan-sdk.outputs.VULKAN_ENABLED }} |
| 86 |
platform: macos |
| 87 |
target: ${{ matrix.target }} |
| 88 |
|
| 89 |
- name: Save Godot build cache |
| 90 |
uses: ./.github/actions/godot-cache-save |
| 91 |
with: |
| 92 |
cache-name: ${{ matrix.cache-name }} |
| 93 |
continue-on-error: true |
| 94 |
|
| 95 |
- name: Prepare artifact |
| 96 |
run: | |
| 97 |
lipo -create ./bin/godot.macos.${{ matrix.target }}.x86_64 ./bin/godot.macos.${{ matrix.target }}.arm64 -output ./bin/godot.macos.${{ matrix.target }}.universal |
| 98 |
rm ./bin/godot.macos.${{ matrix.target }}.x86_64 ./bin/godot.macos.${{ matrix.target }}.arm64 |
| 99 |
strip bin/godot.* |
| 100 |
chmod +x bin/godot.* |
| 101 |
|
| 102 |
- name: Upload artifact |
| 103 |
uses: ./.github/actions/upload-artifact |
| 104 |
with: |
| 105 |
name: ${{ matrix.cache-name }} |
| 106 |
|
| 107 |
- name: Unit tests |
| 108 |
run: | |
| 109 |
${{ matrix.bin }} --version |
| 110 |
${{ matrix.bin }} --help |
| 111 |
${{ matrix.bin }} --test --force-colors |