limboai/.github/workflows/android.yml

278 lines
7.8 KiB
YAML
Raw Permalink Normal View History

2023-08-01 08:25:13 +00:00
name: 🤖 Android builds
on:
workflow_call:
inputs:
godot-ref:
2023-08-01 08:25:13 +00:00
description: A tag, branch or commit hash in the Godot repository.
type: string
default: master
limboai-ref:
2023-08-01 08:25:13 +00:00
description: A tag, branch or commit hash in the LimboAI repository.
type: string
default: master
workflow_dispatch:
inputs:
godot-ref:
2023-08-01 08:25:13 +00:00
description: A tag, branch or commit hash in the Godot repository.
type: string
default: master
limboai-ref:
2023-08-01 08:25:13 +00:00
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:
android-builds:
runs-on: "ubuntu-20.04"
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
2024-08-20 16:49:36 +00:00
# * Standard arm64
2023-08-01 08:25:13 +00:00
- name: Template (arm64, debug)
arch: arm64
target: template_debug
dotnet: false
2023-08-01 08:25:13 +00:00
- name: Template (arm64, release)
arch: arm64
target: template_release
dotnet: false
2023-08-01 08:25:13 +00:00
2024-08-20 16:49:36 +00:00
# * Standard arm32
2023-08-01 08:25:13 +00:00
- name: Template (arm32, debug)
arch: arm32
target: template_debug
dotnet: false
2023-08-01 08:25:13 +00:00
- name: Template (arm32, release)
arch: arm32
target: template_release
dotnet: false
2023-08-01 08:25:13 +00:00
2024-08-20 16:49:36 +00:00
# * Standard x86_64
2023-08-01 08:25:13 +00:00
- name: Template (x86_64, debug)
arch: x86_64
target: template_debug
dotnet: false
2023-08-01 08:25:13 +00:00
- name: Template (x86_64, release)
arch: x86_64
target: template_release
dotnet: false
2023-08-01 08:25:13 +00:00
2024-08-20 16:49:36 +00:00
# * Standard x86_32
2023-08-01 08:25:13 +00:00
- name: Template (x86_32, debug)
arch: x86_32
target: template_debug
dotnet: false
2023-08-01 08:25:13 +00:00
- name: Template (x86_32, release)
arch: x86_32
target: template_release
dotnet: false
2023-08-01 08:25:13 +00:00
2024-08-20 16:49:36 +00:00
# * .NET arm64
- name: Template .NET (arm64, debug)
arch: arm64
target: template_debug
dotnet: true
- name: Template .NET (arm64, release)
arch: arm64
target: template_release
dotnet: true
# * .NET arm32
- name: Template .NET (arm32, debug)
arch: arm32
target: template_debug
dotnet: true
- name: Template .NET (arm32, release)
arch: arm32
target: template_release
dotnet: true
# * .NET x86_64
- name: Template .NET (x86_64, debug)
arch: x86_64
target: template_debug
dotnet: true
- name: Template .NET (x86_64, release)
arch: x86_64
target: template_release
dotnet: true
# * .NET x86_32
- name: Template .NET (x86_32, debug)
arch: x86_32
target: template_debug
dotnet: true
- name: Template .NET (x86_32, release)
arch: x86_32
target: template_release
dotnet: true
2023-08-01 08:25:13 +00:00
env:
2024-08-20 16:49:36 +00:00
BIN: godot.linuxbsd.${{matrix.target}}.${{matrix.arch}}${{ matrix.dotnet == true && '.mono' || '' }}
2023-08-01 08:25:13 +00:00
steps:
- name: Clone Godot
2023-11-09 14:07:29 +00:00
uses: actions/checkout@v4
2023-08-01 08:25:13 +00:00
with:
repository: godotengine/godot
ref: ${{ inputs.godot-ref }}
2023-08-01 08:25:13 +00:00
- name: Clone LimboAI module
2023-11-09 14:07:29 +00:00
uses: actions/checkout@v4
2023-08-01 08:25:13 +00:00
with:
path: modules/limboai
ref: ${{ inputs.limboai-ref }}
2023-08-01 08:25:13 +00:00
2023-08-02 18:51:22 +00:00
# Inits GODOT_VERSION, LIMBOAI_VERSION and NAME_PREFIX environment variables.
- uses: ./modules/limboai/.github/actions/init-version
2023-11-02 09:34:23 +00:00
- name: Set up Java 17
uses: actions/setup-java@v4
2023-08-01 08:25:13 +00:00
with:
distribution: temurin
2023-11-02 09:34:23 +00:00
java-version: 17
2023-08-01 08:25:13 +00:00
- name: Set up scons
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons==4.4.0
python --version
scons --version
# ! Note: we stopped using the scons cache in release builds.
# - name: Set up scons cache
# uses: actions/cache@v4
# with:
# path: ${{github.workspace}}/.scons_cache/
# key: ${{env.BIN}}-${{inputs.godot-ref}}-${{inputs.limboai-ref}}-${{env.LIMBOAI_VERSION}}
# restore-keys: |
# ${{env.BIN}}-${{inputs.godot-ref}}-${{inputs.limboai-ref}}-${{env.LIMBOAI_VERSION}}
# ${{env.BIN}}-${{inputs.godot-ref}}-${{inputs.limboai-ref}}
# ${{env.BIN}}-${{inputs.godot-ref}}
2023-08-01 08:25:13 +00:00
- name: Compilation
env:
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
run: |
2024-08-20 16:49:36 +00:00
scons platform=android target=${{matrix.target}} arch=${{matrix.arch}} module_mono_enabled=${{matrix.dotnet}} ${{env.SCONSFLAGS}}
2023-08-01 08:25:13 +00:00
ls platform/android/java/lib/libs/*
- name: Upload artifact
uses: actions/upload-artifact@v4
2023-08-01 08:25:13 +00:00
with:
2024-08-20 16:49:36 +00:00
name: tmp-android${{matrix.dotnet == true && '-dotnet' || ''}}-templates-${{strategy.job-index}}
2023-08-01 08:25:13 +00:00
path: platform/android/java/lib/libs/*
make-android-package:
runs-on: "ubuntu-20.04"
needs: android-builds
2024-08-20 16:49:36 +00:00
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: Package Android templates
dotnet: false
- name: Package Android .NET templates
dotnet: true
2023-08-01 08:25:13 +00:00
steps:
- name: Clone Godot
2023-11-09 14:07:29 +00:00
uses: actions/checkout@v4
2023-08-01 08:25:13 +00:00
with:
repository: godotengine/godot
ref: ${{ inputs.godot-ref }}
2023-08-01 08:25:13 +00:00
2023-08-02 16:50:17 +00:00
- name: Clone LimboAI module
2023-11-09 14:07:29 +00:00
uses: actions/checkout@v4
2023-08-02 16:50:17 +00:00
with:
path: modules/limboai
ref: ${{ inputs.limboai-ref }}
2023-08-02 16:50:17 +00:00
# Inits GODOT_VERSION, LIMBOAI_VERSION and NAME_PREFIX environment variables.
- uses: ./modules/limboai/.github/actions/init-version
2023-08-01 10:47:53 +00:00
- name: Download Android template builds
uses: actions/download-artifact@v4
2023-08-01 08:25:13 +00:00
with:
2024-08-20 16:49:36 +00:00
pattern: tmp-android${{matrix.dotnet == true && '-dotnet' || ''}}-templates-*
merge-multiple: true
2023-08-01 08:25:13 +00:00
path: platform/android/java/lib/libs/
2023-11-02 09:34:23 +00:00
- name: Set up Java 17
uses: actions/setup-java@v4
2023-08-01 08:25:13 +00:00
with:
distribution: temurin
2023-11-02 09:34:23 +00:00
java-version: 17
2023-08-01 08:25:13 +00:00
- name: Set up Python 3.x
uses: actions/setup-python@v5
2023-08-01 08:25:13 +00:00
with:
python-version: 3.x
architecture: x64
- name: Set up scons
2023-08-01 08:25:13 +00:00
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons==4.4.0
python --version
scons --version
- name: Generate Godot templates
run: |
cd platform/android/java
./gradlew generateGodotTemplates
cd ../../..
ls -l bin/
mkdir -p out/templates/
mv bin/android_* out/templates/
echo "${GODOT_VERSION}.limboai+${LIMBOAI_VERSION}${{matrix.dotnet == true && '.mono' || ''}}" > out/templates/version.txt
2023-08-01 08:25:13 +00:00
ls -l out/*
- name: Delete Android template builds
uses: geekyeggo/delete-artifact@v5
2023-08-01 08:25:13 +00:00
with:
2024-08-20 16:49:36 +00:00
name: tmp-android${{matrix.dotnet == true && '-dotnet' || ''}}-templates-*
useGlob: true
failOnError: false
2023-08-01 08:25:13 +00:00
2023-08-01 10:47:53 +00:00
- name: Upload Android libs
uses: actions/upload-artifact@v4
2023-08-01 08:25:13 +00:00
with:
2024-08-20 16:49:36 +00:00
name: ${{env.NAME_PREFIX}}${{matrix.dotnet == true && '.dotnet' || ''}}.android-lib
2023-08-01 08:25:13 +00:00
path: bin/godot-lib.*
2023-08-01 10:47:53 +00:00
- name: Upload Android templates
uses: actions/upload-artifact@v4
2023-08-01 08:25:13 +00:00
with:
2024-08-20 16:49:36 +00:00
name: ${{env.NAME_PREFIX}}${{matrix.dotnet == true && '.dotnet' || ''}}.export-templates.android
2023-08-01 08:25:13 +00:00
path: out/*