From fb049a1cb50bff942f428cdeb3775762c2a16d59 Mon Sep 17 00:00:00 2001 From: Dolly132 <109222243+Dolly132@users.noreply.github.com> Date: Wed, 9 Sep 2026 11:41:40 +0300 Subject: [PATCH 1/4] feat(inputs): Add os-list input --- .../shared_build_release_am_extension.yml | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/shared_build_release_am_extension.yml b/.github/workflows/shared_build_release_am_extension.yml index 7e797c9..ade465b 100644 --- a/.github/workflows/shared_build_release_am_extension.yml +++ b/.github/workflows/shared_build_release_am_extension.yml @@ -19,25 +19,20 @@ on: description: "The MetaMod Repository branch to compile the extension against" default: "1.12-dev" type: string + os-list: + description: 'JSON array of OSes to build on, e.g. ["ubuntu-22.04"]' + default: '["ubuntu-22.04", "windows-2022"]' + type: string jobs: build: strategy: fail-fast: false matrix: - os: - - ubuntu-24.04 - - windows-2022 + os: ${{ fromJSON(inputs.os-list) }} sm-branch: - master - 1.12-dev - include: - - os: ubuntu-24.04 - cc: clang-14 - cxx: clang++-14 - - os: windows-2022 - cc: msvc - cxx: msvc name: ${{ matrix.os }} (SM ${{ matrix.sm-branch }}) runs-on: ${{ matrix.os }} @@ -46,6 +41,17 @@ jobs: with: submodules: ${{ inputs.submodules }} + - name: Set compiler + shell: bash + run: | + if [ "${{ matrix.os }}" = "windows-2022" ]; then + echo "CC=msvc" >> "$GITHUB_ENV" + echo "CXX=msvc" >> "$GITHUB_ENV" + else + echo "CC=clang-14" >> "$GITHUB_ENV" + echo "CXX=clang++-14" >> "$GITHUB_ENV" + fi + - name: Download artifact uses: actions/download-artifact@v8 if: inputs.artifact-path != '' @@ -57,8 +63,8 @@ jobs: id: ambuild with: os: ${{ matrix.os }} - cc: ${{ matrix.cc }} - cxx: ${{ matrix.cxx }} + cc: ${{ env.CC }} + cxx: ${{ env.CXX }} ambuild-ref: 'master' mm-ref: ${{ inputs.mm-branch }} sm-ref: ${{ matrix.sm-branch }} From 46b71326fd6562cfc4518baec3512c609d0cdd5f Mon Sep 17 00:00:00 2001 From: Dolly <109222243+Dolly132@users.noreply.github.com> Date: Thu, 10 Sep 2026 10:20:50 +0300 Subject: [PATCH 2/4] Update default OS list in build workflow Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/shared_build_release_am_extension.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/shared_build_release_am_extension.yml b/.github/workflows/shared_build_release_am_extension.yml index ade465b..c1da59d 100644 --- a/.github/workflows/shared_build_release_am_extension.yml +++ b/.github/workflows/shared_build_release_am_extension.yml @@ -21,7 +21,7 @@ on: type: string os-list: description: 'JSON array of OSes to build on, e.g. ["ubuntu-22.04"]' - default: '["ubuntu-22.04", "windows-2022"]' + default: '["ubuntu-24.04", "windows-2022"]' type: string jobs: From 40c5880f5686cb75f05b4a8ff5d741d8f2328f51 Mon Sep 17 00:00:00 2001 From: Dolly <109222243+Dolly132@users.noreply.github.com> Date: Thu, 10 Sep 2026 10:22:04 +0300 Subject: [PATCH 3/4] resolve copilot suggestion --- .github/workflows/shared_build_release_am_extension.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/shared_build_release_am_extension.yml b/.github/workflows/shared_build_release_am_extension.yml index c1da59d..92d871c 100644 --- a/.github/workflows/shared_build_release_am_extension.yml +++ b/.github/workflows/shared_build_release_am_extension.yml @@ -44,7 +44,7 @@ jobs: - name: Set compiler shell: bash run: | - if [ "${{ matrix.os }}" = "windows-2022" ]; then + if [[ "${{ matrix.os }}" == windows-* ]]; then echo "CC=msvc" >> "$GITHUB_ENV" echo "CXX=msvc" >> "$GITHUB_ENV" else From b3511076aa8597a412323c43d150e1717527bdbe Mon Sep 17 00:00:00 2001 From: Rushaway Date: Thu, 10 Sep 2026 10:14:49 +0200 Subject: [PATCH 4/4] fix(am-build): repair os-list input YAML and simplify compiler selection - Fix `default:` indentation on the os-list input; it was a sibling of os-list instead of a child, making the whole workflow file invalid YAML and breaking every repo that calls this reusable workflow. - Clarify the os-list description and align its example with the default. - Drop the "Set compiler" step and the GITHUB_ENV round-trip in favour of an inline expression on the ambuild inputs, which also removes the matrix.os -> run: script-injection pattern. Co-Authored-By: Claude Sonnet 5 --- .../shared_build_release_am_extension.yml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/.github/workflows/shared_build_release_am_extension.yml b/.github/workflows/shared_build_release_am_extension.yml index 92d871c..3eae463 100644 --- a/.github/workflows/shared_build_release_am_extension.yml +++ b/.github/workflows/shared_build_release_am_extension.yml @@ -20,8 +20,8 @@ on: default: "1.12-dev" type: string os-list: - description: 'JSON array of OSes to build on, e.g. ["ubuntu-22.04"]' - default: '["ubuntu-24.04", "windows-2022"]' + description: 'JSON array of runner labels to build on (e.g. ["ubuntu-24.04", "windows-2022"])' + default: '["ubuntu-24.04", "windows-2022"]' type: string jobs: @@ -41,17 +41,6 @@ jobs: with: submodules: ${{ inputs.submodules }} - - name: Set compiler - shell: bash - run: | - if [[ "${{ matrix.os }}" == windows-* ]]; then - echo "CC=msvc" >> "$GITHUB_ENV" - echo "CXX=msvc" >> "$GITHUB_ENV" - else - echo "CC=clang-14" >> "$GITHUB_ENV" - echo "CXX=clang++-14" >> "$GITHUB_ENV" - fi - - name: Download artifact uses: actions/download-artifact@v8 if: inputs.artifact-path != '' @@ -63,8 +52,8 @@ jobs: id: ambuild with: os: ${{ matrix.os }} - cc: ${{ env.CC }} - cxx: ${{ env.CXX }} + cc: ${{ startsWith(matrix.os, 'windows') && 'msvc' || 'clang-14' }} + cxx: ${{ startsWith(matrix.os, 'windows') && 'msvc' || 'clang++-14' }} ambuild-ref: 'master' mm-ref: ${{ inputs.mm-branch }} sm-ref: ${{ matrix.sm-branch }}