From f32646743a1fb715924d7ab44ee7a09043b8b975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Wed, 10 Dec 2025 21:13:44 +0100 Subject: [PATCH] Codechange: [CI] setup-vcpkg action is now in OpenTTD/actions (#14897) --- .github/actions/setup-vcpkg/action.yaml | 50 ------------------------- .github/workflows/ci-build.yml | 2 +- .github/workflows/ci-linux.yml | 8 ++-- .github/workflows/ci-macos.yml | 8 ++-- .github/workflows/ci-nightly.yml | 2 +- .github/workflows/ci-windows.yml | 7 ++-- .github/workflows/codeql.yml | 8 ++-- .github/workflows/commit-checker.yml | 2 +- .github/workflows/release-linux.yml | 5 ++- .github/workflows/release-macos.yml | 10 ++--- .github/workflows/release-windows.yml | 9 ++--- .github/workflows/upload-cdn.yml | 4 +- 12 files changed, 28 insertions(+), 87 deletions(-) delete mode 100644 .github/actions/setup-vcpkg/action.yaml diff --git a/.github/actions/setup-vcpkg/action.yaml b/.github/actions/setup-vcpkg/action.yaml deleted file mode 100644 index ebd37190a8..0000000000 --- a/.github/actions/setup-vcpkg/action.yaml +++ /dev/null @@ -1,50 +0,0 @@ -name: 'Setup vcpkg' -description: 'Installs vcpkg and initialises binary caching via NuGet' -inputs: - vcpkg-location: - description: 'Where to install vcpkg' - required: true - mono-install-command: - description: 'Command to run to install mono' - required: false - -runs: - using: "composite" - steps: - - name: Install vcpkg - shell: bash - run: | - git clone https://github.com/microsoft/vcpkg "${{ inputs.vcpkg-location }}" - cd "${{ inputs.vcpkg-location }}" - ./bootstrap-vcpkg.$(if [ "${{ runner.os }}" = "Windows" ]; then echo "bat"; else echo "sh"; fi) -disableMetrics - - - name: Install mono - if: inputs.mono-install-command - shell: bash - run: | - ${{ inputs.mono-install-command }} - echo "MONO=mono" >> "$GITHUB_ENV" - - - name: Setup NuGet Credentials - shell: bash - env: - FEED_URL: 'https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json' - run: | - cd "${{ inputs.vcpkg-location }}" - ${{ env.MONO }} $(./vcpkg fetch nuget | tail -n 1) \ - sources add \ - -source "${{ env.FEED_URL }}" \ - -storepasswordincleartext \ - -name "GitHub" \ - -username "${{ github.repository_owner }}" \ - -password "${{ github.token }}" - ${{ env.MONO }} $(./vcpkg fetch nuget | tail -n 1) \ - setapikey "${{ github.token }}" \ - -source "${{ env.FEED_URL }}" - - - name: Setup vcpkg caching - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;nuget,GitHub,readwrite') - diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 8805550968..81751edde2 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -105,4 +105,4 @@ jobs: steps: - name: Check annotations - uses: OpenTTD/actions/annotation-check@v5 + uses: OpenTTD/actions/annotation-check@v6 diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index e93a136695..fba4a70a92 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -33,10 +33,8 @@ jobs: uses: actions/checkout@v6 - name: Setup vcpkg - uses: ./.github/actions/setup-vcpkg - with: - vcpkg-location: ${{ runner.temp }}/vcpkg - mono-install-command: 'sudo apt-get install -y --no-install-recommends mono-complete' + id: vcpkg + uses: OpenTTD/actions/setup-vcpkg@v6 - name: Install dependencies run: | @@ -67,7 +65,7 @@ jobs: # We only use breakpad from vcpkg, as its CMake files # are a bit special. So the Ubuntu's variant doesn't work. - ${{ runner.temp }}/vcpkg/vcpkg install breakpad + ${{ steps.vcpkg.outputs.vcpkg }} install breakpad echo "::endgroup::" env: diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index bf4ce8fe6b..c310be3a4e 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -35,10 +35,8 @@ jobs: uses: actions/checkout@v6 - name: Setup vcpkg - uses: ./.github/actions/setup-vcpkg - with: - vcpkg-location: ${{ runner.temp }}/vcpkg - mono-install-command: 'brew install mono' + id: vcpkg + uses: OpenTTD/actions/setup-vcpkg@v6 - name: Install OpenGFX run: | @@ -67,7 +65,7 @@ jobs: cmake .. \ -DCMAKE_OSX_ARCHITECTURES=${{ inputs.full_arch }} \ -DVCPKG_TARGET_TRIPLET=${{ inputs.arch }}-osx \ - -DCMAKE_TOOLCHAIN_FILE=${{ runner.temp }}/vcpkg/scripts/buildsystems/vcpkg.cmake \ + -DCMAKE_TOOLCHAIN_FILE=${{ steps.vcpkg.outputs.vcpkg-cmake }} \ ${{ inputs.extra-cmake-parameters }} \ # EOF echo "::endgroup::" diff --git a/.github/workflows/ci-nightly.yml b/.github/workflows/ci-nightly.yml index a4cf09eb48..e5412332a1 100644 --- a/.github/workflows/ci-nightly.yml +++ b/.github/workflows/ci-nightly.yml @@ -57,4 +57,4 @@ jobs: steps: - name: Check annotations - uses: OpenTTD/actions/annotation-check@v5 + uses: OpenTTD/actions/annotation-check@v6 diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index e1bcb6a527..b3556cd3c3 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -21,9 +21,8 @@ jobs: uses: actions/checkout@v6 - name: Setup vcpkg - uses: ./.github/actions/setup-vcpkg - with: - vcpkg-location: ${{ runner.temp }}/vcpkg + id: vcpkg + uses: OpenTTD/actions/setup-vcpkg@v6 - name: Install OpenGFX shell: bash @@ -61,7 +60,7 @@ jobs: cmake .. \ -GNinja \ -DVCPKG_TARGET_TRIPLET=${{ inputs.arch }}-windows-static \ - -DCMAKE_TOOLCHAIN_FILE="${{ runner.temp }}\vcpkg\scripts\buildsystems\vcpkg.cmake" \ + -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.vcpkg-cmake }}" \ # EOF echo "::endgroup::" diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index b93e7fce20..abf9bffbe5 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -28,10 +28,8 @@ jobs: uses: actions/checkout@v6 - name: Setup vcpkg - uses: ./.github/actions/setup-vcpkg - with: - vcpkg-location: ${{ runner.temp }}/vcpkg - mono-install-command: 'sudo apt-get install -y --no-install-recommends mono-complete' + id: vcpkg + uses: OpenTTD/actions/setup-vcpkg@v6 - name: Install dependencies run: | @@ -61,7 +59,7 @@ jobs: # We only use breakpad from vcpkg, as its CMake files # are a bit special. So the Ubuntu's variant doesn't work. - ${{ runner.temp }}/vcpkg/vcpkg install breakpad + ${{ steps.vcpkg.outputs.vcpkg }} install breakpad echo "::endgroup::" env: diff --git a/.github/workflows/commit-checker.yml b/.github/workflows/commit-checker.yml index f656a4b323..16aac87da2 100644 --- a/.github/workflows/commit-checker.yml +++ b/.github/workflows/commit-checker.yml @@ -19,7 +19,7 @@ jobs: fetch-depth: 4 - name: Get pull-request commits - uses: OpenTTD/actions/checkout-pull-request@v5 + uses: OpenTTD/actions/checkout-pull-request@v6 - name: Check commits uses: OpenTTD/OpenTTD-git-hooks@main diff --git a/.github/workflows/release-linux.yml b/.github/workflows/release-linux.yml index 4ccfebfb52..6585dbd07f 100644 --- a/.github/workflows/release-linux.yml +++ b/.github/workflows/release-linux.yml @@ -110,7 +110,8 @@ jobs: echo "::endgroup::" - name: Setup vcpkg - uses: ./.github/actions/setup-vcpkg + id: vcpkg + uses: OpenTTD/actions/setup-vcpkg@v6 with: vcpkg-location: /vcpkg mono-install-command: 'yum install -y mono-complete' @@ -125,7 +126,7 @@ jobs: echo "::group::CMake" cmake ${GITHUB_WORKSPACE} \ - -DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake \ + -DCMAKE_TOOLCHAIN_FILE=${{ steps.vcpkg.outputs.vcpkg-cmake }} \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \ -DOPTION_PACKAGE_DEPENDENCIES=ON \ diff --git a/.github/workflows/release-macos.yml b/.github/workflows/release-macos.yml index bf110a6e8b..265588af63 100644 --- a/.github/workflows/release-macos.yml +++ b/.github/workflows/release-macos.yml @@ -38,10 +38,8 @@ jobs: uses: Swatinem/rust-cache@v2 - name: Setup vcpkg - uses: ./.github/actions/setup-vcpkg - with: - vcpkg-location: ${{ runner.temp }}/vcpkg - mono-install-command: 'brew install mono' + id: vcpkg + uses: OpenTTD/actions/setup-vcpkg@v6 - name: Install dependencies env: @@ -97,7 +95,7 @@ jobs: cmake ${GITHUB_WORKSPACE} \ -DCMAKE_OSX_ARCHITECTURES=arm64 \ -DVCPKG_TARGET_TRIPLET=arm64-osx \ - -DCMAKE_TOOLCHAIN_FILE=${{ runner.temp }}/vcpkg/scripts/buildsystems/vcpkg.cmake \ + -DCMAKE_TOOLCHAIN_FILE=${{ steps.vcpkg.outputs.vcpkg-cmake }} \ -DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \ @@ -118,7 +116,7 @@ jobs: cmake ${GITHUB_WORKSPACE} \ -DCMAKE_OSX_ARCHITECTURES=x86_64 \ -DVCPKG_TARGET_TRIPLET=x64-osx \ - -DCMAKE_TOOLCHAIN_FILE=${{ runner.temp }}/vcpkg/scripts/buildsystems/vcpkg.cmake \ + -DCMAKE_TOOLCHAIN_FILE=${{ steps.vcpkg.outputs.vcpkg-cmake }} \ -DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \ diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml index b84cce9103..51fb5300de 100644 --- a/.github/workflows/release-windows.yml +++ b/.github/workflows/release-windows.yml @@ -46,9 +46,8 @@ jobs: uses: Swatinem/rust-cache@v2 - name: Setup vcpkg - uses: ./.github/actions/setup-vcpkg - with: - vcpkg-location: ${{ runner.temp }}/vcpkg + id: vcpkg + uses: OpenTTD/actions/setup-vcpkg@v6 - name: Install dependencies shell: bash @@ -103,7 +102,7 @@ jobs: cmake ${GITHUB_WORKSPACE} \ -GNinja \ -DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-windows-static \ - -DCMAKE_TOOLCHAIN_FILE="${{ runner.temp }}\vcpkg\scripts\buildsystems\vcpkg.cmake" \ + -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.vcpkg-cmake }}" \ -DOPTION_USE_NSIS=ON \ -DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ @@ -133,7 +132,7 @@ jobs: cmake ${GITHUB_WORKSPACE} \ -GNinja \ -DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-windows-static \ - -DCMAKE_TOOLCHAIN_FILE="${{ runner.temp }}\vcpkg\scripts\buildsystems\vcpkg.cmake" \ + -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.vcpkg-cmake }}" \ -DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \ diff --git a/.github/workflows/upload-cdn.yml b/.github/workflows/upload-cdn.yml index 4033b56927..63330f0555 100644 --- a/.github/workflows/upload-cdn.yml +++ b/.github/workflows/upload-cdn.yml @@ -88,7 +88,7 @@ jobs: - prepare name: Publish bundles - uses: OpenTTD/actions/.github/workflows/rw-cdn-upload.yml@v5 + uses: OpenTTD/actions/.github/workflows/rw-cdn-upload.yml@v6 secrets: CDN_SIGNING_KEY: ${{ secrets.CDN_SIGNING_KEY }} DEPLOYMENT_APP_ID: ${{ secrets.DEPLOYMENT_APP_ID }} @@ -103,7 +103,7 @@ jobs: - prepare name: Publish symbols - uses: OpenTTD/actions/.github/workflows/rw-symbols-upload.yml@v5 + uses: OpenTTD/actions/.github/workflows/rw-symbols-upload.yml@v6 secrets: SYMBOLS_SIGNING_KEY: ${{ secrets.SYMBOLS_SIGNING_KEY }} with: