From db1bf6a0e089af7c11af9d65dbe6505f60e9211b Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Sat, 29 Jul 2023 23:16:10 +0200 Subject: [PATCH] GH: Refactor workflows to use inputs and better artifact names --- .github/workflows/linux.yml | 35 +++++++++++++++++++++++------------ .github/workflows/macos.yml | 12 ++++-------- .github/workflows/runner.yml | 22 ++++++++++++++++++---- .github/workflows/windows.yml | 33 ++++++++++++++++++++++----------- 4 files changed, 67 insertions(+), 35 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 2c9f953..076ab50 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,21 +1,32 @@ -name: 🐧 Linux Builds +name: 🐧 Linux 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: - - # push: - # branches: [ github-workflows ] + 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: - GODOT_TREEISH: 4.1.1-stable - LIMBOAI_TREEISH: v0.4.1-stable - VERSION_STRING: 4.1.1-limboai+v0.4.1 - SCONS_CACHE_LIMIT: 4096 - SCONSFLAGS: production=yes tests=no verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes + SCONSFLAGS: production=yes tests=no verbose=yes warnings=extra werror=yes DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true @@ -95,13 +106,13 @@ jobs: - uses: actions/checkout@v3 with: repository: godotengine/godot - ref: ${{ env.GODOT_TREEISH }} + ref: ${{ inputs.godot_treeish }} # Clone limboai module - uses: actions/checkout@v3 with: path: modules/limboai - ref: ${{ env.LIMBOAI_TREEISH }} + ref: ${{ inputs.limboai_treeish }} # About sed see: https://github.com/godotengine/buildroot/issues/6 - name: Setup buildroot x86_64 @@ -150,7 +161,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v3 with: - name: ${{ env.BIN }} + name: godot.limboai.${{matrix.target}}.linux.${{matrix.arch}} path: bin/* diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index b43e906..f82eb53 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,4 +1,4 @@ -name: 🍎 macOS +name: 🍎 macOS builds on: workflow_call: inputs: @@ -25,9 +25,8 @@ on: # Global Settings env: - SCONS_CACHE_MSVC_CONFIG: true SCONS_CACHE_LIMIT: 4096 - SCONSFLAGS: production=yes tests=no verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes + SCONSFLAGS: production=yes tests=no verbose=yes warnings=extra werror=yes DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true @@ -192,11 +191,6 @@ jobs: steps: - # ! REMOVE ME - - name: Test - run: | - ls -l - - name: Clone Godot uses: actions/checkout@v3 with: @@ -220,6 +214,7 @@ jobs: mkdir -p out/editor/Godot.app/Contents/MacOS cp bin/godot.macos.editor.universal out/editor/Godot.app/Contents/MacOS/Godot chmod +x out/editor/Godot.app/Contents/MacOS/Godot + ls out/editor/ - name: Upload editor bundle uses: actions/upload-artifact@v3 @@ -249,6 +244,7 @@ jobs: rm bin/* mkdir -p out/templates/ mv macos.zip out/templates/macos.zip + ls out/templates/ - name: Upload templates bundle uses: actions/upload-artifact@v3 diff --git a/.github/workflows/runner.yml b/.github/workflows/runner.yml index 674640a..9924862 100644 --- a/.github/workflows/runner.yml +++ b/.github/workflows/runner.yml @@ -1,10 +1,15 @@ name: 🔗 GHA on: workflow_dispatch: - - # push: - # branches: [ github-workflows ] - + 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 jobs: # android-build: @@ -18,14 +23,23 @@ jobs: linux-build: name: 🐧 Linux uses: ./.github/workflows/linux.yml + with: + godot_treeish: ${{ inputs.godot_treeish }} + limboai_treeish: ${{ inputs.limboai_treeish }} macos-build: name: 🍎 macOS uses: ./.github/workflows/macos.yml + with: + godot_treeish: ${{ inputs.godot_treeish }} + limboai_treeish: ${{ inputs.limboai_treeish }} windows-build: name: 🪟 Windows uses: ./.github/workflows/windows.yml + with: + godot_treeish: ${{ inputs.godot_treeish }} + limboai_treeish: ${{ inputs.limboai_treeish }} # web-build: # name: 🌐 Web diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 82bae9a..f5cc755 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,21 +1,32 @@ name: 🪟 Windows 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: - - # push: - # branches: [ github-workflows ] + 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: - GODOT_TREEISH: 4.1.1-stable - LIMBOAI_TREEISH: master - VERSION_STRING: 4.1.1-limboai+dev - SCONS_CACHE_MSVC_CONFIG: true SCONS_CACHE_LIMIT: 4096 - SCONSFLAGS: production=yes tests=no verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes + SCONSFLAGS: production=yes tests=no verbose=yes warnings=extra werror=yes DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true @@ -95,13 +106,13 @@ jobs: - uses: actions/checkout@v3 with: repository: godotengine/godot - ref: ${{ env.GODOT_TREEISH }} + ref: ${{ inputs.godot_treeish }} # Clone LimboAI module - uses: actions/checkout@v3 with: path: modules/limboai - ref: ${{ env.LIMBOAI_TREEISH }} + ref: ${{ inputs.limboai_treeish }} # Use python 3.x release (works cross platform) - name: Set up Python 3.x @@ -145,5 +156,5 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v3 with: - name: ${{ env.BIN }} + name: godot.limboai.${{matrix.target}}.windows.${{matrix.arch}} path: bin/*