Skip to content

Commit

Permalink
GHA: Attempt to use new upload/download actions
Browse files Browse the repository at this point in the history
  • Loading branch information
limbonaut committed Mar 10, 2024
1 parent 3ae38ee commit 40ad44d
Show file tree
Hide file tree
Showing 12 changed files with 319 additions and 204 deletions.
3 changes: 2 additions & 1 deletion .github/actions/init-version-gdext/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ runs:
- name: Set NAME_PREFIX
shell: bash
run: echo "NAME_PREFIX=limboai+${LIMBOAI_VERSION}.gdextension-${GDEXTENSION_VERSION}" >> "$GITHUB_ENV"
run: |
echo "NAME_PREFIX=limboai+${LIMBOAI_VERSION}.gdextension-${GDEXTENSION_VERSION}" >> "$GITHUB_ENV"
65 changes: 44 additions & 21 deletions .github/workflows/all_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,27 @@ name: 🔗 All builds
on:
workflow_dispatch:
inputs:
godot-treeish:
godot-ref:
description: A tag, branch or commit hash in the Godot repository.
type: string
default: 4.2
limboai-treeish:
limboai-ref:
description: A tag, branch or commit hash in the LimboAI repository.
type: string
default: master
godot-cpp-treeish:
godot-cpp-ref:
description: A tag, branch or commit hash in the godot-cpp repository.
type: string
default: 4.2

permissions:
actions: write
contents: read
packages: read

jobs:
cache-sha:
name: Cache treeish SHA
name: Cache SHA
runs-on: ubuntu-latest
outputs:
godot-sha: ${{ steps.cache-sha.outputs.godot-sha }}
Expand All @@ -27,13 +32,13 @@ jobs:
uses: actions/checkout@v4
with:
repository: godotengine/godot
ref: ${{ inputs.godot-treeish }}
ref: ${{ inputs.godot-ref }}

- name: Clone LimboAI module
uses: actions/checkout@v4
with:
path: modules/limboai
ref: ${{ inputs.limboai-treeish }}
ref: ${{ inputs.limboai-ref }}

- name: Cache SHA
id: cache-sha
Expand All @@ -47,63 +52,81 @@ jobs:
needs: cache-sha
uses: ./.github/workflows/android.yml
with:
godot-treeish: ${{ needs.cache-sha.outputs.godot-sha }}
limboai-treeish: ${{ needs.cache-sha.outputs.limboai-sha }}
godot-ref: ${{ needs.cache-sha.outputs.godot-sha }}
limboai-ref: ${{ needs.cache-sha.outputs.limboai-sha }}

ios-build:
name: 🍏 iOS
needs: cache-sha
uses: ./.github/workflows/ios.yml
with:
godot-treeish: ${{ needs.cache-sha.outputs.godot-sha }}
limboai-treeish: ${{ needs.cache-sha.outputs.limboai-sha }}
godot-ref: ${{ needs.cache-sha.outputs.godot-sha }}
limboai-ref: ${{ needs.cache-sha.outputs.limboai-sha }}

linux-build:
name: 🐧 Linux
needs: cache-sha
uses: ./.github/workflows/linux.yml
with:
godot-treeish: ${{ needs.cache-sha.outputs.godot-sha }}
limboai-treeish: ${{ needs.cache-sha.outputs.limboai-sha }}
godot-ref: ${{ needs.cache-sha.outputs.godot-sha }}
limboai-ref: ${{ needs.cache-sha.outputs.limboai-sha }}
test-build: false

macos-build:
name: 🍎 macOS
needs: cache-sha
uses: ./.github/workflows/macos.yml
with:
godot-treeish: ${{ needs.cache-sha.outputs.godot-sha }}
limboai-treeish: ${{ needs.cache-sha.outputs.limboai-sha }}
godot-ref: ${{ needs.cache-sha.outputs.godot-sha }}
limboai-ref: ${{ needs.cache-sha.outputs.limboai-sha }}

windows-build:
name: 🪟 Windows
needs: cache-sha
uses: ./.github/workflows/windows.yml
with:
godot-treeish: ${{ needs.cache-sha.outputs.godot-sha }}
limboai-treeish: ${{ needs.cache-sha.outputs.limboai-sha }}
godot-ref: ${{ needs.cache-sha.outputs.godot-sha }}
limboai-ref: ${{ needs.cache-sha.outputs.limboai-sha }}
test-build: false

web-build:
name: 🌐 Web
needs: cache-sha
uses: ./.github/workflows/web.yml
with:
godot-treeish: ${{ needs.cache-sha.outputs.godot-sha }}
limboai-treeish: ${{ needs.cache-sha.outputs.limboai-sha }}
godot-ref: ${{ needs.cache-sha.outputs.godot-sha }}
limboai-ref: ${{ needs.cache-sha.outputs.limboai-sha }}

gdextension:
name: 🔌 GDExtension
needs: cache-sha
uses: ./.github/workflows/gdextension.yml
with:
godot-cpp-treeish: ${{ inputs.godot-cpp-treeish }}
limboai-treeish: ${{ needs.cache-sha.outputs.limboai-sha }}
godot-cpp-ref: ${{ inputs.godot-cpp-ref }}
limboai-ref: ${{ needs.cache-sha.outputs.limboai-sha }}
test-build: false

demo:
name: 🎮️ Demo project
needs: cache-sha
uses: ./.github/workflows/demo.yml
with:
limboai-treeish: ${{ needs.cache-sha.outputs.limboai-sha }}
limboai-ref: ${{ needs.cache-sha.outputs.limboai-sha }}

merge_templates:
name: 📦 Merge templates
if: ${{ always() }}
needs:
[
cache-sha,
android-build,
ios-build,
linux-build,
macos-build,
windows-build,
web-build,
]
uses: ./.github/workflows/merge_templates.yml
with:
godot-ref: ${{ needs.cache-sha.outputs.godot-sha }}
limboai-ref: ${{ needs.cache-sha.outputs.limboai-sha }}
52 changes: 29 additions & 23 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ name: 🤖 Android builds
on:
workflow_call:
inputs:
godot-treeish:
godot-ref:
description: A tag, branch or commit hash in the Godot repository.
type: string
default: master
limboai-treeish:
limboai-ref:
description: A tag, branch or commit hash in the LimboAI repository.
type: string
default: master

workflow_dispatch:
inputs:
godot-treeish:
godot-ref:
description: A tag, branch or commit hash in the Godot repository.
type: string
default: master
limboai-treeish:
limboai-ref:
description: A tag, branch or commit hash in the LimboAI repository.
type: string
default: master
Expand All @@ -29,6 +29,11 @@ env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true

permissions:
actions: write
contents: read
packages: read

jobs:
android-builds:
runs-on: "ubuntu-20.04"
Expand Down Expand Up @@ -77,13 +82,13 @@ jobs:
uses: actions/checkout@v4
with:
repository: godotengine/godot
ref: ${{ inputs.godot-treeish }}
ref: ${{ inputs.godot-ref }}

- name: Clone LimboAI module
uses: actions/checkout@v4
with:
path: modules/limboai
ref: ${{ inputs.limboai-treeish }}
ref: ${{ inputs.limboai-ref }}

# Inits GODOT_VERSION, LIMBOAI_VERSION and NAME_PREFIX environment variables.
- uses: ./modules/limboai/.github/actions/init-version
Expand All @@ -105,11 +110,11 @@ jobs:
uses: actions/cache@v4
with:
path: ${{github.workspace}}/.scons_cache/
key: ${{env.BIN}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}}-${{env.LIMBOAI_VERSION}}
key: ${{env.BIN}}-${{inputs.godot-ref}}-${{inputs.limboai-ref}}-${{env.LIMBOAI_VERSION}}
restore-keys: |
${{env.BIN}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}}-${{env.LIMBOAI_VERSION}}
${{env.BIN}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}}
${{env.BIN}}-${{inputs.godot-treeish}}
${{env.BIN}}-${{inputs.godot-ref}}-${{inputs.limboai-ref}}-${{env.LIMBOAI_VERSION}}
${{env.BIN}}-${{inputs.godot-ref}}-${{inputs.limboai-ref}}
${{env.BIN}}-${{inputs.godot-ref}}
- name: Compilation
env:
Expand All @@ -119,12 +124,11 @@ jobs:
ls platform/android/java/lib/libs/*
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: android-templates
name: tmp-android-templates-${{strategy.job-index}}
path: platform/android/java/lib/libs/*


make-android-package:
runs-on: "ubuntu-20.04"
name: Make Android package
Expand All @@ -135,21 +139,22 @@ jobs:
uses: actions/checkout@v4
with:
repository: godotengine/godot
ref: ${{ inputs.godot-treeish }}
ref: ${{ inputs.godot-ref }}

- name: Clone LimboAI module
uses: actions/checkout@v4
with:
path: modules/limboai
ref: ${{ inputs.limboai-treeish }}
ref: ${{ inputs.limboai-ref }}

# Inits GODOT_VERSION, LIMBOAI_VERSION and NAME_PREFIX environment variables.
- uses: ./modules/limboai/.github/actions/init-version

- name: Download Android template builds
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: android-templates
pattern: tmp-android-templates-*
merge-multiple: true
path: platform/android/java/lib/libs/

- name: Set up Java 17
Expand Down Expand Up @@ -184,19 +189,20 @@ jobs:
ls -l out/*
- name: Delete Android template builds
uses: geekyeggo/delete-artifact@v2
uses: geekyeggo/delete-artifact@v4
with:
name: android-templates
failOnError: false
name: tmp-android-templates-*
useGlob: true
failOnError: false

- name: Upload Android libs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{env.NAME_PREFIX}}.android-lib
path: bin/godot-lib.*

- name: Upload Android templates
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{env.NAME_PREFIX}}.export-templates
name: ${{env.NAME_PREFIX}}.export-templates.android
path: out/*
8 changes: 4 additions & 4 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: 🎮️ Demo project
on:
workflow_call:
inputs:
limboai-treeish:
limboai-ref:
description: A tag, branch or commit hash in the LimboAI repository.
type: string
default: master

workflow_dispatch:
inputs:
limboai-treeish:
limboai-ref:
description: A tag, branch or commit hash in the LimboAI repository.
type: string
default: master
Expand All @@ -24,7 +24,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-tags: true
ref: ${{ inputs.limboai-treeish }}
ref: ${{ inputs.limboai-ref }}

- name: Prepare artifact
shell: bash
Expand All @@ -33,7 +33,7 @@ jobs:
cp {README,LICENSE}.md demo/
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
env:
NAME: limboai+${{env.LIMBOAI_VERSION}}.demo-project
with:
Expand Down
Loading

0 comments on commit 40ad44d

Please sign in to comment.