From cc6a0e7b44a4f6de56fa93d66517834e4bbfaf62 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Wed, 2 Aug 2023 18:50:17 +0200 Subject: [PATCH 1/4] GH: Add better build versioning scheme --- .github/actions/init-version/action.yml | 15 +++++++++++++++ .github/workflows/android.yml | 10 +++++++++- .github/workflows/ios.yml | 10 +++++++++- .github/workflows/linux.yml | 10 +++------- .github/workflows/macos.yml | 10 +++++++++- .github/workflows/web.yml | 4 +++- .github/workflows/windows.yml | 4 +++- 7 files changed, 51 insertions(+), 12 deletions(-) create mode 100644 .github/actions/init-version/action.yml diff --git a/.github/actions/init-version/action.yml b/.github/actions/init-version/action.yml new file mode 100644 index 0000000..8b2d392 --- /dev/null +++ b/.github/actions/init-version/action.yml @@ -0,0 +1,15 @@ +name: Setup version + +runs: + using: "composite" + steps: + - name: Set GODOT_VERSION & LIMBOAI_VERSION + shell: bash + run: | + echo "GODOT_VERSION=$( (git describe --tags --exact-match HEAD || git rev-parse --short HEAD) | sed 's/\(.*\)-\(.*\)/\1/g' )" >> "$GITHUB_ENV" + cd modules/limboai + echo "LIMBOAI_VERSION=$( (git describe --tags --exact-match HEAD || git rev-parse --short HEAD) | sed 's/\(.*\)-\(.*\)/\1/g' )" >> "$GITHUB_ENV" + + - name: Set NAME_PREFIX + shell: bash + run: echo "NAME_PREFIX=godot-${GODOT_VERSION}.limboai+${LIMBOAI_VERSION}" >> "$GITHUB_ENV" diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 9961f8c..ddd2267 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -28,7 +28,6 @@ env: SCONSFLAGS: production=yes tests=no verbose=yes warnings=extra werror=yes DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true - NAME_PREFIX: godot.${{inputs.godot-treeish}}.limboai+${{inputs.limboai-treeish}} jobs: android-builds: @@ -135,6 +134,15 @@ jobs: repository: godotengine/godot ref: ${{ inputs.godot-treeish }} + - name: Clone LimboAI module + uses: actions/checkout@v3 + with: + path: modules/limboai + ref: ${{ inputs.limboai-treeish }} + + # 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 with: diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 6a5c64a..fba74d6 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -29,7 +29,6 @@ env: SCONSFLAGS: production=yes tests=no verbose=yes warnings=extra werror=yes DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true - NAME_PREFIX: godot.${{inputs.godot-treeish}}.limboai+${{inputs.limboai-treeish}} jobs: @@ -146,6 +145,15 @@ jobs: repository: godotengine/godot ref: ${{ inputs.godot-treeish }} + - name: Clone LimboAI module + uses: actions/checkout@v3 + with: + path: modules/limboai + ref: ${{ inputs.limboai-treeish }} + + # Inits GODOT_VERSION, LIMBOAI_VERSION and NAME_PREFIX environment variables. + - uses: ./modules/limboai/.github/actions/init-version + - name: Set up Vulkan SDK run: | sh misc/scripts/install_vulkan_sdk_macos.sh diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 1fda2f3..ec9d154 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -28,7 +28,6 @@ env: SCONSFLAGS: production=yes tests=no verbose=yes warnings=extra werror=yes DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true - NAME_PREFIX: godot.${{inputs.godot-treeish}}.limboai+${{inputs.limboai-treeish}} jobs: linux-builds: @@ -102,12 +101,6 @@ jobs: BIN: godot.linuxbsd.${{matrix.target}}.${{matrix.arch}}${{ matrix.build-mono == true && '.mono' || '' }} steps: - - name: Dump environment - env: - ENVI: ${{ toJson(env) }} - run: | - echo "$ENVI" - - name: Clone Godot uses: actions/checkout@v3 with: @@ -120,6 +113,9 @@ jobs: path: modules/limboai ref: ${{ inputs.limboai-treeish }} + # Inits GODOT_VERSION, LIMBOAI_VERSION and NAME_PREFIX environment variables. + - uses: ./modules/limboai/.github/actions/init-version + # About sed see: https://github.com/godotengine/buildroot/issues/6 - name: Set up buildroot x86_64 if: matrix.arch == 'x86_64' diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 884517e..504114d 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -29,7 +29,6 @@ env: SCONSFLAGS: production=yes tests=no verbose=yes warnings=extra werror=yes DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true - NAME_PREFIX: godot.${{inputs.godot-treeish}}.limboai+${{inputs.limboai-treeish}} jobs: macos-builds: @@ -206,6 +205,15 @@ jobs: repository: godotengine/godot ref: ${{ inputs.godot-treeish }} + - name: Clone LimboAI module + uses: actions/checkout@v3 + with: + path: modules/limboai + ref: ${{ inputs.limboai-treeish }} + + # 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 with: diff --git a/.github/workflows/web.yml b/.github/workflows/web.yml index 203694a..38cae0c 100644 --- a/.github/workflows/web.yml +++ b/.github/workflows/web.yml @@ -29,7 +29,6 @@ env: SCONSFLAGS: use_static_cpp=yes debug_symbols=no lto=thin optimize=size verbose=yes warnings=extra werror=yes tests=no EM_VERSION: 3.1.18 EM_CACHE_FOLDER: "emsdk-cache" - NAME_PREFIX: godot.${{inputs.godot-treeish}}.limboai+${{inputs.limboai-treeish}} jobs: web-builds: @@ -71,6 +70,9 @@ jobs: path: modules/limboai ref: ${{ inputs.limboai-treeish }} + # Inits GODOT_VERSION, LIMBOAI_VERSION and NAME_PREFIX environment variables. + - uses: ./modules/limboai/.github/actions/init-version + - name: Set up Emscripten latest uses: mymindstorm/setup-emsdk@v12 with: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 396b12a..21c146a 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -29,7 +29,6 @@ env: SCONSFLAGS: production=yes tests=no verbose=yes warnings=extra werror=yes DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true - NAME_PREFIX: godot.${{inputs.godot-treeish}}.limboai+${{inputs.limboai-treeish}} jobs: windows-builds: @@ -115,6 +114,9 @@ jobs: path: modules/limboai ref: ${{ inputs.limboai-treeish }} + # Inits GODOT_VERSION, LIMBOAI_VERSION and NAME_PREFIX environment variables. + - uses: ./modules/limboai/.github/actions/init-version + - name: Set up Python 3.x uses: actions/setup-python@v4 with: From 5fa574b352a04536d2dbb8f261ff6729bb353e47 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Wed, 2 Aug 2023 20:51:22 +0200 Subject: [PATCH 2/4] GH: Apply custom version to the builds --- .github/actions/init-version/action.yml | 6 ++++++ .github/workflows/android.yml | 3 +++ .github/workflows/ios.yml | 3 +++ .github/workflows/macos.yml | 3 +++ 4 files changed, 15 insertions(+) diff --git a/.github/actions/init-version/action.yml b/.github/actions/init-version/action.yml index 8b2d392..089e289 100644 --- a/.github/actions/init-version/action.yml +++ b/.github/actions/init-version/action.yml @@ -13,3 +13,9 @@ runs: - name: Set NAME_PREFIX shell: bash run: echo "NAME_PREFIX=godot-${GODOT_VERSION}.limboai+${LIMBOAI_VERSION}" >> "$GITHUB_ENV" + + - name: Set GODOT_VERSION_STATUS & BUILD_NAME + shell: bash + run: | + echo "GODOT_VERSION_STATUS=limboai+${LIMBOAI_VERSION}" >> "$GITHUB_ENV" + echo "BUILD_NAME=gha" >> "$GITHUB_ENV" diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index ddd2267..8c57104 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -85,6 +85,9 @@ jobs: path: modules/limboai ref: ${{ inputs.limboai-treeish }} + # Inits GODOT_VERSION, LIMBOAI_VERSION and NAME_PREFIX environment variables. + - uses: ./modules/limboai/.github/actions/init-version + - name: Set up Java 11 uses: actions/setup-java@v3 with: diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index fba74d6..4db9047 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -89,6 +89,9 @@ jobs: path: modules/limboai ref: ${{ inputs.limboai-treeish }} + # Inits GODOT_VERSION, LIMBOAI_VERSION and NAME_PREFIX environment variables. + - uses: ./modules/limboai/.github/actions/init-version + - name: Set up Python 3.x uses: actions/setup-python@v4 with: diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 504114d..2651bd7 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -132,6 +132,9 @@ jobs: path: modules/limboai ref: ${{ inputs.limboai-treeish }} + # Inits GODOT_VERSION, LIMBOAI_VERSION and NAME_PREFIX environment variables. + - uses: ./modules/limboai/.github/actions/init-version + - name: Set up Python 3.x uses: actions/setup-python@v4 with: From 9a6b7dc3582785b5c879c35f27edddcb950aa7a2 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Thu, 3 Aug 2023 00:17:50 +0200 Subject: [PATCH 3/4] GH: Use shorter version status for .net on linux and windows --- .github/workflows/linux.yml | 4 ++++ .github/workflows/windows.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index ec9d154..9a604f7 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -157,11 +157,15 @@ jobs: - name: Generate C# glue if: matrix.build-mono && matrix.target == 'editor' + env: + GODOT_VERSION_STATUS: limboai run: | ./bin/$BIN --headless --generate-mono-glue ./modules/mono/glue || true - name: Build .NET solutions if: matrix.build-mono && matrix.target == 'editor' + env: + GODOT_VERSION_STATUS: limboai run: | ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=linuxbsd diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 21c146a..5840ed8 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -151,11 +151,15 @@ jobs: - name: Generate C# glue if: matrix.build-mono && matrix.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.build-mono && matrix.target == 'editor' + env: + GODOT_VERSION_STATUS: limboai run: | ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=windows From 1b75091dd6d0ae7c1d9b7fce19adf1b3228e25be Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Thu, 3 Aug 2023 11:16:46 +0200 Subject: [PATCH 4/4] GH: Fix windows .NET build failing to generate solutions --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 5840ed8..db4f9d3 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -161,7 +161,7 @@ jobs: env: GODOT_VERSION_STATUS: limboai run: | - ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=windows + python ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=windows - name: Prepare artifact shell: bash