diff --git a/.github/actions/init-version-gdext/action.yml b/.github/actions/init-version-gdext/action.yml index efb5c98..ca39fd9 100644 --- a/.github/actions/init-version-gdext/action.yml +++ b/.github/actions/init-version-gdext/action.yml @@ -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" diff --git a/.github/workflows/all_builds.yml b/.github/workflows/all_builds.yml index 12a19a4..a1280f2 100644 --- a/.github/workflows/all_builds.yml +++ b/.github/workflows/all_builds.yml @@ -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 }} @@ -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 @@ -47,24 +52,24 @@ 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: @@ -72,16 +77,16 @@ jobs: 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: @@ -89,16 +94,16 @@ jobs: 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: @@ -106,4 +111,22 @@ jobs: 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 }} diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 0a60654..85e02cb 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -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 @@ -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" @@ -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 @@ -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: @@ -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 @@ -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 @@ -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/* diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index 9aa6339..b26b5f8 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -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 @@ -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 @@ -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: diff --git a/.github/workflows/gdextension.yml b/.github/workflows/gdextension.yml index 896d27e..7cc0649 100644 --- a/.github/workflows/gdextension.yml +++ b/.github/workflows/gdextension.yml @@ -2,11 +2,11 @@ name: ๐Ÿ”Œ GDExtension on: workflow_call: inputs: - godot-cpp-treeish: + godot-cpp-ref: description: A tag, branch or commit hash in the godot-cpp 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 @@ -17,11 +17,11 @@ on: workflow_dispatch: inputs: - godot-cpp-treeish: + godot-cpp-ref: description: A tag, branch or commit hash in the godot-cpp 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 @@ -41,6 +41,8 @@ jobs: gdextension: runs-on: ${{ matrix.opts.runner }} name: ${{ matrix.opts.name }} + outputs: + name-prefix: ${{ steps.output-name-prefix.outputs.name-prefix }} strategy: fail-fast: false matrix: @@ -114,18 +116,22 @@ jobs: repository: godotengine/godot-cpp fetch-tags: true path: godot-cpp - ref: ${{ inputs.godot-cpp-treeish }} + ref: ${{ inputs.godot-cpp-ref }} - name: Clone LimboAI module uses: actions/checkout@v4 with: path: limboai fetch-tags: true - ref: ${{ inputs.limboai-treeish }} + ref: ${{ inputs.limboai-ref }} # Inits GDEXTENSION_VERSION, LIMBOAI_VERSION and NAME_PREFIX environment variables. - uses: ./limboai/.github/actions/init-version-gdext + - name: Output NAME_PREFIX + id: output-name-prefix + run: echo "name-prefix=${NAME_PREFIX}" >> $GITHUB_OUTPUT + - name: Set up Linux buildroot x86_64 if: matrix.opts.platform == 'linux' && matrix.opts.arch == 'x86_64' run: | @@ -188,11 +194,11 @@ jobs: uses: actions/cache@v4 with: path: ${{github.workspace}}/.scons_cache/ - key: ${{env.BIN}}-${{inputs.godot-cpp-treeish}}-${{inputs.limboai-treeish}}-${{env.LIMBOAI_VERSION}} + key: ${{env.BIN}}-${{inputs.godot-cpp-ref}}-${{inputs.limboai-ref}}-${{env.LIMBOAI_VERSION}} restore-keys: | - ${{env.BIN}}-${{inputs.godot-cpp-treeish}}-${{inputs.limboai-treeish}}-${{env.LIMBOAI_VERSION}} - ${{env.BIN}}-${{inputs.godot-cpp-treeish}}-${{inputs.limboai-treeish}} - ${{env.BIN}}-${{inputs.godot-cpp-treeish}} + ${{env.BIN}}-${{inputs.godot-cpp-ref}}-${{inputs.limboai-ref}}-${{env.LIMBOAI_VERSION}} + ${{env.BIN}}-${{inputs.godot-cpp-ref}}-${{inputs.limboai-ref}} + ${{env.BIN}}-${{inputs.godot-cpp-ref}} - name: Setup project structure for GDExtension shell: bash @@ -237,9 +243,22 @@ jobs: ls -l -R out/addons/limboai/bin/ - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 env: - NAME: ${{env.NAME_PREFIX}} + NAME: tmp-gdextension.${{matrix.opts.platform}}.${{matrix.opts.target}}.${{matrix.opts.arch}} with: name: ${{ env.NAME }} path: out/* + + merge-artifacts: + name: Merge artifacts + runs-on: ubuntu-latest + needs: gdextension + + steps: + - name: Merge artifacts + uses: actions/upload-artifact/merge@v4 + with: + name: ${{needs.gdextension.outputs.name-prefix}} + pattern: tmp-gdextension.* + delete-merged: true diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index ce928c1..b1e1847 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -2,22 +2,22 @@ name: ๐Ÿ iOS 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 @@ -29,6 +29,11 @@ env: DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true +permissions: + actions: write + contents: read + packages: read + jobs: ios-builds: runs-on: "macos-latest" @@ -78,13 +83,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 @@ -114,11 +119,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: @@ -127,9 +132,9 @@ jobs: scons platform=ios target=${{matrix.target}} arch=${{matrix.arch}} ios_simulator=${{matrix.ios_simulator}} ${{env.SCONSFLAGS}} - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: ios-templates + name: tmp-ios-templates-${{strategy.job-index}} path: bin/* package-ios-templates: @@ -142,13 +147,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 @@ -158,9 +163,10 @@ jobs: sh misc/scripts/install_vulkan_sdk_macos.sh - name: Download templates artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: - name: ios-templates + pattern: tmp-ios-templates-* + merge-multiple: true path: bin/ - name: Make template bundle @@ -192,13 +198,14 @@ jobs: ls -l ${{github.workspace}}/out/* - name: Upload template bundle - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: ${{env.NAME_PREFIX}}.export-templates + name: ${{env.NAME_PREFIX}}.export-templates.ios path: out/* - name: Delete templates artifact - uses: geekyeggo/delete-artifact@v2 + uses: geekyeggo/delete-artifact@v4 with: - name: ios-templates - failOnError: false + name: tmp-ios-templates-* + useGlob: true + failOnError: false diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index a33d518..0e0d2be 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -2,11 +2,11 @@ name: ๐Ÿง Linux 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 @@ -17,11 +17,11 @@ on: 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 @@ -48,93 +48,93 @@ jobs: - name: Editor (x86_64, release) target: editor arch: x86_64 - build-mono: false + dotnet: false should-build: true - name: Template (x86_64, release) target: template_release arch: x86_64 - build-mono: false + dotnet: false should-build: true - name: Template (x86_64, debug) target: template_debug arch: x86_64 - build-mono: false + dotnet: false should-build: ${{ !inputs.test-build }} # - name: Editor (x86_32, release) # target: editor # arch: x86_32 - # build-mono: false + # dotnet: false # should-build: ${{ !inputs.test-build }} - name: Template (x86_32, release) target: template_release arch: x86_32 - build-mono: false + dotnet: false should-build: ${{ !inputs.test-build }} - name: Template (x86_32, debug) target: template_debug arch: x86_32 - build-mono: false + dotnet: false should-build: ${{ !inputs.test-build }} - name: Editor .NET (x86_64, release) target: editor arch: x86_64 - build-mono: true + dotnet: true should-build: ${{ !inputs.test-build }} - name: Template .NET (x86_64, release) target: template_release arch: x86_64 - build-mono: true + dotnet: true should-build: ${{ !inputs.test-build }} - name: Template .NET (x86_64, debug) target: template_debug arch: x86_64 - build-mono: true + dotnet: true should-build: ${{ !inputs.test-build }} # - name: Editor .NET (x86_32, release) # target: editor # arch: x86_32 - # build-mono: true + # dotnet: true # should-build: ${{ !inputs.test-build }} - name: Template .NET (x86_32, release) target: template_release arch: x86_32 - build-mono: true + dotnet: true should-build: ${{ !inputs.test-build }} - name: Template .NET (x86_32, debug) target: template_debug arch: x86_32 - build-mono: true + dotnet: true should-build: ${{ !inputs.test-build }} exclude: - { opts: { should-build: false } } env: - BIN: godot.linuxbsd.${{matrix.opts.target}}.${{matrix.opts.arch}}${{ matrix.opts.build-mono == true && '.mono' || '' }} + BIN: godot.linuxbsd.${{matrix.opts.target}}.${{matrix.opts.arch}}${{ matrix.opts.dotnet == true && '.mono' || '' }} steps: - name: Clone Godot 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 @@ -165,28 +165,28 @@ 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: SCONS_CACHE: ${{github.workspace}}/.scons_cache/ run: | PATH=${GITHUB_WORKSPACE}/buildroot/bin:$PATH - scons platform=linuxbsd target=${{matrix.opts.target}} arch=${{matrix.opts.arch}} module_mono_enabled=${{matrix.opts.build-mono}} ${{env.SCONSFLAGS}} + scons platform=linuxbsd target=${{matrix.opts.target}} arch=${{matrix.opts.arch}} module_mono_enabled=${{matrix.opts.dotnet}} ${{env.SCONSFLAGS}} - name: Generate C# glue - if: matrix.opts.build-mono && matrix.opts.target == 'editor' + if: matrix.opts.dotnet && matrix.opts.target == 'editor' env: GODOT_VERSION_STATUS: limboai run: | ./bin/$BIN --headless --generate-mono-glue ./modules/mono/glue || true - name: Build .NET solutions - if: matrix.opts.build-mono && matrix.opts.target == 'editor' + if: matrix.opts.dotnet && matrix.opts.target == 'editor' env: GODOT_VERSION_STATUS: limboai run: | @@ -224,10 +224,7 @@ jobs: ls -R out/ - name: Upload artifact - uses: actions/upload-artifact@v3 - env: - NAME_EDITOR: ${{env.NAME_PREFIX}}.${{matrix.opts.target}}.linux.${{matrix.opts.arch}}${{ matrix.opts.build-mono == true && '.mono' || '' }} - NAME_TEMPLATES: ${{env.NAME_PREFIX}}.export-templates${{ matrix.opts.build-mono == true && '.mono' || '' }} + uses: actions/upload-artifact@v4 with: - name: ${{ startsWith(matrix.opts.target, 'template') && env.NAME_TEMPLATES || env.NAME_EDITOR }} + name: ${{env.NAME_PREFIX}}${{matrix.opts.dotnet == true && '.dotnet' || ''}}.${{matrix.opts.target}}.linux.${{matrix.opts.arch}} path: out/* diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index ea56fff..f1b0f13 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -2,11 +2,11 @@ name: ๐ŸŽ macOS 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 @@ -17,11 +17,11 @@ on: 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 @@ -37,6 +37,11 @@ env: DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true +permissions: + actions: write + contents: read + packages: read + jobs: macos-builds: runs-on: "macos-latest" @@ -50,42 +55,36 @@ jobs: target: editor arch: x86_64 build-mono: false - artifact-name: macos-editor should-build: true - name: Template (x86_64, release) target: template_release arch: x86_64 build-mono: false - artifact-name: macos-templates should-build: ${{ !inputs.test-build }} - name: Template (x86_64, debug) target: template_debug arch: x86_64 build-mono: false - artifact-name: macos-templates should-build: ${{ !inputs.test-build }} - name: Editor (arm64, release) target: editor arch: arm64 build-mono: false - artifact-name: macos-editor should-build: true - name: Template (arm64, release) target: template_release arch: arm64 build-mono: false - artifact-name: macos-templates should-build: ${{ !inputs.test-build }} - name: Template (arm64, debug) target: template_debug arch: arm64 build-mono: false - artifact-name: macos-templates should-build: ${{ !inputs.test-build }} # ! Disabled for now: .NET version fails to build @@ -145,13 +144,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 @@ -181,11 +180,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: @@ -193,7 +192,7 @@ jobs: run: | scons -j2 platform=macos target=${{matrix.opts.target}} arch=${{matrix.opts.arch}} module_mono_enabled=${{matrix.opts.build-mono}} ${{env.SCONSFLAGS}} - # ! Disabled for now: .NET version fail to build + # ! Disabled for now: .NET version fails to build # - name: Generate C# glue # if: matrix.opts.build-mono && matrix.opts.target == 'editor' @@ -211,9 +210,9 @@ jobs: chmod +x bin/godot.* - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: ${{ matrix.opts.artifact-name }} + name: tmp-macos-${{matrix.opts.target}}-${{matrix.opts.arch}} path: bin/* make-macos-bundle: @@ -226,21 +225,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 editor artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: - name: macos-editor + pattern: tmp-macos-editor-* + merge-multiple: true path: bin/ # Zipping the editor bundle to retain executable bit; @@ -264,16 +264,17 @@ jobs: ls out/editor/ - name: Upload editor bundle - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{env.NAME_PREFIX}}.editor.macos.universal path: out/editor/* - name: Download templates artifact if: ${{ !inputs.test-build }} - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: - name: macos-templates + pattern: tmp-macos-template_* + merge-multiple: true path: bin/ - name: Make templates bundle @@ -297,15 +298,15 @@ jobs: echo "${GODOT_VERSION}.limboai+${LIMBOAI_VERSION}" > out/templates/version.txt ls out/templates/ - - uses: geekyeggo/delete-artifact@v2 + - uses: geekyeggo/delete-artifact@v4 with: - name: macos-* - useGlob: true - failOnError: false + name: tmp-macos-* + useGlob: true + failOnError: false - name: Upload templates bundle if: ${{ !inputs.test-build }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: ${{env.NAME_PREFIX}}.export-templates + name: ${{env.NAME_PREFIX}}.export-templates.macos path: out/* diff --git a/.github/workflows/merge_templates.yml b/.github/workflows/merge_templates.yml new file mode 100644 index 0000000..538e4c1 --- /dev/null +++ b/.github/workflows/merge_templates.yml @@ -0,0 +1,52 @@ +name: ๐Ÿ“ฆ๏ธ Merge templates +on: + workflow_call: + inputs: + godot-ref: + description: A tag, branch or commit hash in the Godot repository. + type: string + limboai-ref: + description: A tag, branch or commit hash in the LimboAI repository. + type: string + + workflow_dispatch: + inputs: + godot-ref: + description: A tag, branch or commit hash in the Godot repository. + type: string + limboai-ref: + description: A tag, branch or commit hash in the LimboAI repository. + type: string + +jobs: + merge-templates: + runs-on: ubuntu-latest + steps: + - name: Clone Godot + uses: actions/checkout@v4 + with: + repository: godotengine/godot + ref: ${{ inputs.godot-ref }} + + - name: Clone LimboAI module + uses: actions/checkout@v4 + with: + path: modules/limboai + ref: ${{ inputs.limboai-ref }} + + # Inits GODOT_VERSION, LIMBOAI_VERSION and NAME_PREFIX environment variables. + - uses: ./modules/limboai/.github/actions/init-version + + - name: Merge classical templates + uses: actions/upload-artifact/merge@v4 + with: + name: ${{env.NAME_PREFIX}}.export-templates + pattern: ${{env.NAME_PREFIX}}.{export-templates,template_}* + delete-merged: true + + - name: Merge .NET templates + uses: actions/upload-artifact/merge@v4 + with: + name: ${{env.NAME_PREFIX}}.dotnet.export-templates + pattern: ${{env.NAME_PREFIX}}.dotnet.{export-templates,template_}* + delete-merged: true diff --git a/.github/workflows/test_builds.yml b/.github/workflows/test_builds.yml index 563d40e..bb80ee4 100644 --- a/.github/workflows/test_builds.yml +++ b/.github/workflows/test_builds.yml @@ -29,6 +29,11 @@ env: GODOT_REF: "4.2" GODOT_CPP_REF: "4.2" +permissions: + actions: write + contents: read + packages: read + jobs: unit-tests: name: ๐Ÿงช Unit tests @@ -124,8 +129,8 @@ jobs: needs: cache-env uses: ./.github/workflows/linux.yml with: - godot-treeish: ${{ needs.cache-env.outputs.godot-ref }} - limboai-treeish: ${{ github.sha }} + godot-ref: ${{ needs.cache-env.outputs.godot-ref }} + limboai-ref: ${{ github.sha }} test-build: true windows-test-build: @@ -133,8 +138,8 @@ jobs: needs: cache-env uses: ./.github/workflows/windows.yml with: - godot-treeish: ${{ needs.cache-env.outputs.godot-ref }} - limboai-treeish: ${{ github.sha }} + godot-ref: ${{ needs.cache-env.outputs.godot-ref }} + limboai-ref: ${{ github.sha }} test-build: true macos-test-build: @@ -142,8 +147,8 @@ jobs: needs: cache-env uses: ./.github/workflows/macos.yml with: - godot-treeish: ${{ needs.cache-env.outputs.godot-ref }} - limboai-treeish: ${{ github.sha }} + godot-ref: ${{ needs.cache-env.outputs.godot-ref }} + limboai-ref: ${{ github.sha }} test-build: true gdextension: @@ -151,6 +156,6 @@ jobs: needs: cache-env uses: ./.github/workflows/gdextension.yml with: - godot-cpp-treeish: ${{ needs.cache-env.outputs.godot-cpp-ref }} - limboai-treeish: ${{ github.sha }} + godot-cpp-ref: ${{ needs.cache-env.outputs.godot-cpp-ref }} + limboai-ref: ${{ github.sha }} test-build: true diff --git a/.github/workflows/web.yml b/.github/workflows/web.yml index e82fa3e..da9371d 100644 --- a/.github/workflows/web.yml +++ b/.github/workflows/web.yml @@ -2,22 +2,22 @@ name: ๐ŸŒ Web 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 @@ -40,35 +40,35 @@ jobs: include: - name: Template (release) target: template_release - dlink_enabled: false + dlink: false - name: Template (release, dlink_enabled=true) target: template_release - dlink_enabled: true + dlink: true - name: Template (debug) target: template_debug - dlink_enabled: false + dlink: false - name: Template (debug, dlink_enabled=true) target: template_debug - dlink_enabled: true + dlink: true env: - CACHE_NAME: godot.web.${{matrix.target}}${{ matrix.dlink_enabled == true && '.dlink' || '' }} + CACHE_NAME: godot.web.${{matrix.target}}${{ matrix.dlink == true && '.dlink' || '' }} steps: - name: Clone Godot 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 @@ -100,17 +100,17 @@ jobs: uses: actions/cache@v4 with: path: ${{github.workspace}}/.scons_cache/ - key: ${{env.CACHE_NAME}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}}-${{env.LIMBOAI_VERSION}} + key: ${{env.CACHE_NAME}}-${{inputs.godot-ref}}-${{inputs.limboai-ref}}-${{env.LIMBOAI_VERSION}} restore-keys: | - ${{env.CACHE_NAME}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}}-${{env.LIMBOAI_VERSION}} - ${{env.CACHE_NAME}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}} - ${{env.CACHE_NAME}}-${{inputs.godot-treeish}} + ${{env.CACHE_NAME}}-${{inputs.godot-ref}}-${{inputs.limboai-ref}}-${{env.LIMBOAI_VERSION}} + ${{env.CACHE_NAME}}-${{inputs.godot-ref}}-${{inputs.limboai-ref}} + ${{env.CACHE_NAME}}-${{inputs.godot-ref}} - name: Compilation env: SCONS_CACHE: ${{github.workspace}}/.scons_cache/ run: | - scons platform=web target=${{matrix.target}} dlink_enabled=${{matrix.dlink_enabled}} ${{env.SCONSFLAGS}} + scons platform=web target=${{matrix.target}} dlink_enabled=${{matrix.dlink}} ${{env.SCONSFLAGS}} - name: Prepare artifacts run: | @@ -123,7 +123,7 @@ jobs: echo "${GODOT_VERSION}.limboai+${LIMBOAI_VERSION}" > out/templates/version.txt - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: ${{env.NAME_PREFIX}}.export-templates + name: ${{env.NAME_PREFIX}}.${{matrix.target}}.web${{matrix.dlink == true && '.dlink' || ''}} path: out/* diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 8c45490..195bc8a 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -2,11 +2,11 @@ name: ๐ŸชŸ Windows 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 @@ -17,11 +17,11 @@ on: 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 @@ -49,93 +49,93 @@ jobs: - name: Editor (x86_64, release) target: editor arch: x86_64 - build-mono: false + dotnet: false should-build: true - name: Template (x86_64, release) target: template_release arch: x86_64 - build-mono: false + dotnet: false should-build: ${{ !inputs.test-build }} - name: Template (x86_64, debug) target: template_debug arch: x86_64 - build-mono: false + dotnet: false should-build: ${{ !inputs.test-build }} # - name: Editor (x86_32, release) # target: editor # arch: x86_32 - # build-mono: false + # dotnet: false # should-build: ${{ !inputs.test-build }} - name: Template (x86_32, release) target: template_release arch: x86_32 - build-mono: false + dotnet: false should-build: ${{ !inputs.test-build }} - name: Template (x86_32, debug) target: template_debug arch: x86_32 - build-mono: false + dotnet: false should-build: ${{ !inputs.test-build }} - name: Editor .NET (x86_64, release) target: editor arch: x86_64 - build-mono: true + dotnet: true should-build: true - name: Template .NET (x86_64, release) target: template_release arch: x86_64 - build-mono: true + dotnet: true should-build: ${{ !inputs.test-build }} - name: Template .NET (x86_64, debug) target: template_debug arch: x86_64 - build-mono: true + dotnet: true should-build: ${{ !inputs.test-build }} # - name: Editor .NET (x86_32, release) # target: editor # arch: x86_32 - # build-mono: true + # dotnet: true # should-build: ${{ !inputs.test-build }} - name: Template .NET (x86_32, release) target: template_release arch: x86_32 - build-mono: true + dotnet: true should-build: ${{ !inputs.test-build }} - name: Template .NET (x86_32, debug) target: template_debug arch: x86_32 - build-mono: true + dotnet: true should-build: ${{ !inputs.test-build }} exclude: - { opts: { should-build: false } } env: - BIN: godot.windows.${{matrix.opts.target}}.${{matrix.opts.arch}}${{ matrix.opts.build-mono == true && '.mono' || '' }} + BIN: godot.windows.${{matrix.opts.target}}.${{matrix.opts.arch}}${{ matrix.opts.dotnet == true && '.mono' || '' }} steps: - name: Clone Godot 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 @@ -160,27 +160,27 @@ 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: SCONS_CACHE: ${{github.workspace}}/.scons_cache/ run: | - scons -j2 platform=windows target=${{matrix.opts.target}} arch=${{matrix.opts.arch}} module_mono_enabled=${{matrix.opts.build-mono}} ${{env.SCONSFLAGS}} + scons -j2 platform=windows target=${{matrix.opts.target}} arch=${{matrix.opts.arch}} module_mono_enabled=${{matrix.opts.dotnet}} ${{env.SCONSFLAGS}} - name: Generate C# glue - if: matrix.opts.build-mono && matrix.opts.target == 'editor' + if: matrix.opts.dotnet && matrix.opts.target == 'editor' env: GODOT_VERSION_STATUS: limboai run: | ./bin/${{ env.BIN }} --headless --generate-mono-glue ./modules/mono/glue || true - name: Build .NET solutions - if: matrix.opts.build-mono && matrix.opts.target == 'editor' + if: matrix.opts.dotnet && matrix.opts.target == 'editor' env: GODOT_VERSION_STATUS: limboai run: | @@ -208,10 +208,7 @@ jobs: ls -R out/ - name: Upload artifact - uses: actions/upload-artifact@v3 - env: - NAME_EDITOR: ${{env.NAME_PREFIX}}.${{matrix.opts.target}}.windows.${{matrix.opts.arch}}${{ matrix.opts.build-mono == true && '.mono' || '' }} - NAME_TEMPLATES: ${{env.NAME_PREFIX}}.export-templates${{ matrix.opts.build-mono == true && '.mono' || '' }} + uses: actions/upload-artifact@v4 with: - name: ${{ startsWith(matrix.opts.target, 'template') && env.NAME_TEMPLATES || env.NAME_EDITOR }} + name: ${{env.NAME_PREFIX}}${{matrix.opts.dotnet == true && '.dotnet' || ''}}.${{matrix.opts.target}}.windows.${{matrix.opts.arch}} path: out/*