GH: Create iOS workflow

This commit is contained in:
Serhii Snitsaruk 2023-08-01 12:47:53 +02:00
parent cd621ee3ea
commit 74bb5ead32
2 changed files with 192 additions and 3 deletions

View File

@ -134,7 +134,7 @@ jobs:
repository: godotengine/godot repository: godotengine/godot
ref: ${{ inputs.godot_treeish }} ref: ${{ inputs.godot_treeish }}
- name: Fetch editor artifact - name: Download Android template builds
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: android-templates name: android-templates
@ -175,13 +175,13 @@ jobs:
name: android-templates name: android-templates
failOnError: false failOnError: false
- name: Upload Android lib - name: Upload Android libs
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: godot.limboai.android-lib name: godot.limboai.android-lib
path: bin/godot-lib.* path: bin/godot-lib.*
- name: Upload templates - name: Upload Android templates
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: godot.limboai.export-templates name: godot.limboai.export-templates

189
.github/workflows/ios.yml vendored Normal file
View File

@ -0,0 +1,189 @@
name: 🍏 iOS builds
on:
workflow_call:
inputs:
godot_treeish:
description: A tag, branch or commit hash in the Godot repository.
type: string
default: master
limboai_treeish:
description: A tag, branch or commit hash in the LimboAI repository.
type: string
default: master
workflow_dispatch:
inputs:
godot_treeish:
description: A tag, branch or commit hash in the Godot repository.
type: string
default: master
limboai_treeish:
description: A tag, branch or commit hash in the LimboAI repository.
type: string
default: master
# Global Settings
env:
SCONS_CACHE_LIMIT: 4096
SCONSFLAGS: production=yes tests=no verbose=yes warnings=extra werror=yes
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
ios-builds:
runs-on: "macos-latest"
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: Template (arm64, release)
target: template_release
arch: arm64
ios_simulator: false
- name: Template (arm64, debug)
target: template_debug
arch: arm64
ios_simulator: false
- name: Simulator Lib (x86_64, release)
target: template_release
arch: x86_64
ios_simulator: true
- name: Simulator Lib (x86_64, debug)
target: template_debug
arch: x86_64
ios_simulator: true
- name: Simulator Lib (arm64, release)
target: template_release
arch: arm64
ios_simulator: true
- name: Simulator Lib (arm64, debug)
target: template_debug
arch: arm64
ios_simulator: true
env:
BIN: godot.ios.${{matrix.target}}.${{matrix.arch}}
steps:
- name: Clone Godot
uses: actions/checkout@v3
with:
repository: godotengine/godot
ref: ${{ inputs.godot_treeish }}
- name: Clone LimboAI module
uses: actions/checkout@v3
with:
path: modules/limboai
ref: ${{ inputs.limboai_treeish }}
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: '3.x'
architecture: 'x64'
- name: Setup scons
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons==4.4.0
- name: Diagnostics
run: |
python --version
scons --version
dotnet --info
- name: Setup Vulkan SDK
run: |
sh misc/scripts/install_vulkan_sdk_macos.sh
# Upload cache on completion and check it out now
- name: Load .scons_cache directory
uses: actions/cache@v3
with:
path: ${{github.workspace}}/.scons_cache/
key: ${{matrix.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
restore-keys: |
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}
- name: Compilation
env:
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
run: |
scons platform=ios target=${{matrix.target}} arch=${{matrix.arch}} ios_simulator=${{matrix.ios_simulator}} ${{env.SCONSFLAGS}}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ios-templates
path: bin/*
package-ios-templates:
runs-on: "macos-latest"
name: Package iOS templates
needs: ios-builds
steps:
- name: Clone Godot
uses: actions/checkout@v3
with:
repository: godotengine/godot
ref: ${{ inputs.godot_treeish }}
- name: Setup Vulkan SDK
run: |
sh misc/scripts/install_vulkan_sdk_macos.sh
- name: Fetch templates artifact
uses: actions/download-artifact@v3
with:
name: ios-templates
path: bin/
- name: Make template bundle
run: |
ls bin/
cp -r misc/dist/ios_xcode bin/
cd bin/
strip *.a
mv libgodot.ios.template_debug.arm64.a ios_xcode/libgodot.ios.debug.xcframework/ios-arm64/libgodot.a
lipo -create libgodot.ios.template_debug.arm64.simulator.a libgodot.ios.template_debug.x86_64.simulator.a -output ios_xcode/libgodot.ios.debug.xcframework/ios-arm64_x86_64-simulator/libgodot.a
mv libgodot.ios.template_release.arm64.a ios_xcode/libgodot.ios.release.xcframework/ios-arm64/libgodot.a
lipo -create libgodot.ios.template_release.arm64.simulator.a libgodot.ios.template_release.x86_64.simulator.a -output ios_xcode/libgodot.ios.release.xcframework/ios-arm64_x86_64-simulator/libgodot.a
cp -r ~/VulkanSDK/*/MoltenVK/MoltenVK.xcframework ios_xcode
rm -rf ios_xcode/MoltenVK.xcframework/{macos,tvos}*
mkdir -p ${{github.workspace}}/out/templates/
cd ios_xcode
zip -q -9 -r ${{github.workspace}}/out/templates/ios.zip *
ls -l ${{github.workspace}}/out/*
- name: Upload templates bundle
uses: actions/upload-artifact@v3
with:
name: godot.limboai.export-templates
path: out/*
- uses: geekyeggo/delete-artifact@v2
with:
name: ios-templates
failOnError: false