Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/actions/godot-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ runs:
- name: SCons Build
shell: sh
run: |
echo "Building with flags:" platform=${{ inputs.platform }} target=${{ inputs.target }} ${{ inputs.scons-flags }} "cache_path=${{ inputs.scons-cache }}" redirect_build_objects=no
echo "Building with flags:" --cache-debug=- platform=${{ inputs.platform }} target=${{ inputs.target }} ${{ inputs.scons-flags }} "cache_path=${{ inputs.scons-cache }}" redirect_build_objects=no

if [ "${{ inputs.target }}" != "editor" ]; then
# Ensure we don't include editor code in export template builds.
Expand All @@ -38,5 +38,5 @@ runs:
export BUILD_NAME="gh"
fi

scons platform=${{ inputs.platform }} target=${{ inputs.target }} ${{ inputs.scons-flags }} "cache_path=${{ inputs.scons-cache }}" redirect_build_objects=no
scons --cache-debug=- platform=${{ inputs.platform }} target=${{ inputs.target }} ${{ inputs.scons-flags }} "cache_path=${{ inputs.scons-cache }}" redirect_build_objects=no
ls -l bin/
106 changes: 72 additions & 34 deletions .github/workflows/macos_builds.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
name: 🍎 macOS Builds
on:
workflow_call:
inputs:
job-name:
type: string
required: true
target:
type: string
required: true
artifact-name:
type: string
required: true
scons-flags:
type: string
default: ""

# Global Settings
env:
Expand All @@ -12,22 +25,12 @@ env:
jobs:
build-macos:
runs-on: macos-latest
name: ${{ matrix.name }}
name: Compile ${{ inputs.target }} (${{ matrix.arch }})
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
include:
- name: Editor (target=editor)
cache-name: macos-editor
target: editor
bin: ./bin/redot.macos.editor.universal

- name: Template (target=template_release)
cache-name: macos-template
target: template_release
scons-flags: debug_symbols=no
bin: ./bin/redot.macos.template_release.universal
arch: [x86_64, arm64]

steps:
- name: Checkout
Expand All @@ -41,7 +44,7 @@ jobs:
- name: Restore Godot build cache
uses: ./.github/actions/godot-cache-restore
with:
cache-name: ${{ matrix.cache-name }}
cache-name: ${{ inputs.artifact-name }}-${{ matrix.arch }}
continue-on-error: true

- name: Setup Python and SCons
Expand Down Expand Up @@ -69,40 +72,75 @@ jobs:
fi
continue-on-error: true

- name: Compilation (x86_64)
- name: Compilation
uses: ./.github/actions/godot-build
with:
scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.scons-flags }} arch=x86_64 vulkan=${{ steps.vulkan-sdk.outputs.VULKAN_ENABLED }}
scons-flags: ${{ env.SCONS_FLAGS }} ${{ inputs.scons-flags }} arch=${{ matrix.arch }} vulkan=${{ steps.vulkan-sdk.outputs.VULKAN_ENABLED }}
platform: macos
target: ${{ matrix.target }}

- name: Compilation (arm64)
uses: ./.github/actions/godot-build
with:
scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.scons-flags }} arch=arm64 vulkan=${{ steps.vulkan-sdk.outputs.VULKAN_ENABLED }}
platform: macos
target: ${{ matrix.target }}
target: ${{ inputs.target }}

- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
with:
cache-name: ${{ matrix.cache-name }}
cache-name: ${{ inputs.artifact-name }}-${{ matrix.arch }}
continue-on-error: true

- name: Prepare artifact
- name: Upload architecture binary
uses: actions/upload-artifact@v7
with:
name: ${{ inputs.artifact-name }}-slice-${{ matrix.arch }}
path: bin/redot.macos.${{ inputs.target }}.${{ matrix.arch }}
if-no-files-found: error
overwrite: true
retention-days: 30

package-macos:
needs: build-macos
if: ${{ !cancelled() }}
runs-on: macos-latest
name: ${{ inputs.job-name }}
timeout-minutes: 15
env:
BIN_BASE: ./bin/redot.macos.${{ inputs.target }}

steps:
- name: Require successful builds
if: needs.build-macos.result != 'success'
run: |
echo "::error::Both architecture builds must succeed before packaging."
exit 1

- name: Select Xcode 26
run: sudo xcode-select -s /Applications/Xcode_26.0.1.app

- name: Checkout test fixtures
uses: actions/checkout@v6

- name: Download architecture binaries
uses: actions/download-artifact@v8
with:
pattern: ${{ inputs.artifact-name }}-slice-*
path: bin
merge-multiple: true

- name: Create universal binary
run: |
lipo -create ./bin/redot.macos.${{ matrix.target }}.x86_64 ./bin/redot.macos.${{ matrix.target }}.arm64 -output ./bin/redot.macos.${{ matrix.target }}.universal
rm ./bin/redot.macos.${{ matrix.target }}.x86_64 ./bin/redot.macos.${{ matrix.target }}.arm64
strip bin/redot.*
chmod +x bin/redot.*
lipo -create "$BIN_BASE.x86_64" "$BIN_BASE.arm64" -output "$BIN_BASE.universal"
lipo "$BIN_BASE.universal" -verify_arch x86_64 arm64
strip "$BIN_BASE.universal"
chmod +x "$BIN_BASE.universal"

- name: Upload artifact
uses: ./.github/actions/upload-artifact
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.cache-name }}
name: ${{ inputs.artifact-name }}
path: bin/redot.macos.${{ inputs.target }}.universal
if-no-files-found: error
overwrite: true
retention-days: 60

- name: Unit tests
run: |
${{ matrix.bin }} --version
${{ matrix.bin }} --help
${{ matrix.bin }} --test --force-colors
"$BIN_BASE.universal" --version
"$BIN_BASE.universal" --help
"$BIN_BASE.universal" --test --force-colors
Comment thread
Arctis-Fireblight marked this conversation as resolved.
Resolved
16 changes: 15 additions & 1 deletion .github/workflows/runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,24 @@ jobs:
needs: static-checks
uses: ./.github/workflows/linux_builds.yml

macos-build:
macos-editor:
name: 🍎 macOS
needs: static-checks
uses: ./.github/workflows/macos_builds.yml
with:
job-name: Editor (target=editor)
target: editor
artifact-name: macos-editor

macos-template:
name: 🍎 macOS
needs: static-checks
uses: ./.github/workflows/macos_builds.yml
with:
job-name: Template (target=template_release)
target: template_release
artifact-name: macos-template
scons-flags: debug_symbols=no

windows-build:
name: 🏁 Windows
Expand Down
Loading