Workaround vox scene importer lockup. #350
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |