From cc6a0e7b44a4f6de56fa93d66517834e4bbfaf62 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Wed, 2 Aug 2023 18:50:17 +0200 Subject: [PATCH] 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: