Skip to content

Commit

Permalink
add process template
Browse files Browse the repository at this point in the history
  • Loading branch information
kuruk-mm committed Oct 31, 2024
1 parent 2d8e527 commit a46b2ea
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 13 deletions.
7 changes: 6 additions & 1 deletion .github/actions/upload-artifact/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ inputs:
description: The path to upload.
required: true
default: "bin/*"
retention-days:
description: Retention days for the artifact
required: false
default: 14

runs:
using: "composite"
steps:
Expand All @@ -16,4 +21,4 @@ runs:
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
retention-days: 14
retention-days: ${{ inputs.retention-days }}
30 changes: 23 additions & 7 deletions .github/workflows/ios_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,32 @@ on:

# Global Settings
env:
# Used for the cache key. Add version suffix to force clean build.
GODOT_BASE_BRANCH: 4.2
SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no module_text_server_fb_enabled=yes
SCONSFLAGS: verbose=yes warnings=no production=yes use_lto=yes

concurrency:
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-ios
group: ci-${{ github.actor }}-${{ github.head_ref || github.run_number }}-${{ github.ref }}-ios
cancel-in-progress: true

jobs:
ios-template:
runs-on: "macos-latest"
name: Template (target=template_release)
strategy:
matrix:
include:
- target: template_release
ios_simulator: no
arch: arm64
- target: template_debug
ios_simulator: no
arch: arm64
- target: template_release
ios_simulator: yes
arch: x86_64
- target: template_debug
ios_simulator: yes
arch: x86_64
name: Template (target=${{ matrix.target }}, ios_simulator=${{ matrix.ios_simulator }}, arch=${{ matrix.arch }})

steps:
- uses: actions/checkout@v4
Expand All @@ -27,13 +41,15 @@ jobs:
- name: Setup python and scons
uses: ./.github/actions/godot-deps

- name: Compilation (arm64)
- name: Compilation (${{matrix.arch}})
uses: ./.github/actions/godot-build
with:
sconsflags: ${{ env.SCONSFLAGS }}
sconsflags: ${{ env.SCONSFLAGS }} ios_simulator=${{ matrix.ios_simulator }} arch=${{ matrix.arch }}
platform: ios
target: template_release
target: ${{ matrix.target }}
tests: false

- name: Upload artifact
uses: ./.github/actions/upload-artifact
with:
retention-days: 1
58 changes: 58 additions & 0 deletions .github/workflows/process_templates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Process templates
on:
workflow_call:

# Global Settings
env:
GODOT_VERSION: 4.2.1

concurrency:
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-process-templates
cancel-in-progress: true

jobs:
process-templates:
runs-on: "ubuntu-22.04"
name: Process Godot Templates

steps:
- name: Download artifacts from ios-template
uses: actions/download-artifact@v3
with:
path: ./artifacts

- name: Download Godot Templates
run: |
curl -L -o Godot_export_templates.tpz https://github.com/godotengine/godot/releases/download/${{ env.GODOT_VERSION }}-stable/Godot_v${{ env.GODOT_VERSION }}-stable_export_templates.tpz
unzip Godot_export_templates.tpz
- name: Uncompress ios.zip from Godot Templates
run: unzip -q templates/ios.zip -d ios

- name: Prepare iOS Files
run: |
cp ./artifacts/ios-template/libgodot.ios.template_debug.arm64.a ios/libgodot.ios.debug.xcframework/ios-arm64/libgodot.a
cp ./artifacts/ios-template/libgodot.ios.template_release.arm64.a ios/libgodot.ios.release.xcframework/ios-arm64/libgodot.a
cp ./artifacts/ios-template/libgodot.ios.template_debug.x86_64.simulator.a ios/libgodot.ios.debug.xcframework/ios-arm64_x86_64-simulator/libgodot.a
cp ./artifacts/ios-template/libgodot.ios.template_release.x86_64.simulator.a ios/libgodot.ios.release.xcframework/ios-arm64_x86_64-simulator/libgodot.a
cd ios
zip -q -9 -r ../ios.zip .
cd ..
cp ios.zip templates/ios.zip
- name: Upload templates
uses: actions/upload-artifact@v4
with:
name: templates
retention-days: 1 # enought time to release
path: |
templates/ios.zip
templates/android_debug.apk
templates/android_release.apk
templates/android_source.zip
templates/linux_debug.x86_64
templates/linux_release.x86_64
templates/macos.zip
templates/version.txt
templates/windows_debug_x86_64.exe
templates/windows_release_x86_64.exe
15 changes: 10 additions & 5 deletions .github/workflows/runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:

# Second stage: Run all the builds and some of the tests.

android-build:
if: ${{ vars.DISABLE_GODOT_CI == '' }}
name: 🤖 Android
#needs: static-checks
uses: ./.github/workflows/android_builds.yml
# android-build:
# if: ${{ vars.DISABLE_GODOT_CI == '' }}
# name: 🤖 Android
# #needs: static-checks
# uses: ./.github/workflows/android_builds.yml

ios-build:
if: ${{ vars.DISABLE_GODOT_CI == '' }}
Expand All @@ -45,3 +45,8 @@ jobs:
# needs: static-checks
# uses: ./.github/workflows/windows_builds.yml

process-templates:
if: ${{ vars.DISABLE_GODOT_CI == '' }}
name: Process templates
needs: ios-build
uses: ./.github/workflows/process_templates.yml

0 comments on commit a46b2ea

Please sign in to comment.