diff --git a/.github/actions/setup-vcpkg/action.yaml b/.github/actions/setup-vcpkg/action.yaml index 47dd267d0d..ebd37190a8 100644 --- a/.github/actions/setup-vcpkg/action.yaml +++ b/.github/actions/setup-vcpkg/action.yaml @@ -4,6 +4,9 @@ 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" @@ -15,11 +18,33 @@ runs: 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('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite') + core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;nuget,GitHub,readwrite') diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index ef71377e23..2883cb55d7 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -36,6 +36,7 @@ jobs: uses: ./.github/actions/setup-vcpkg with: vcpkg-location: ${{ runner.temp }}/vcpkg + mono-install-command: 'sudo apt-get install -y --no-install-recommends mono-complete' - name: Install dependencies run: | diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index 30d6c01886..972615f865 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -38,6 +38,7 @@ jobs: uses: ./.github/actions/setup-vcpkg with: vcpkg-location: ${{ runner.temp }}/vcpkg + mono-install-command: 'brew install mono' - name: Install OpenGFX run: | diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 031142c3f0..0aaaea5e00 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -30,6 +30,7 @@ jobs: uses: ./.github/actions/setup-vcpkg with: vcpkg-location: ${{ runner.temp }}/vcpkg + mono-install-command: 'sudo apt-get install -y --no-install-recommends mono-complete' - name: Install dependencies run: | diff --git a/.github/workflows/release-linux.yml b/.github/workflows/release-linux.yml index 914b5b472b..c7f1956a6e 100644 --- a/.github/workflows/release-linux.yml +++ b/.github/workflows/release-linux.yml @@ -113,6 +113,7 @@ jobs: uses: ./.github/actions/setup-vcpkg with: vcpkg-location: /vcpkg + mono-install-command: 'yum install -y mono-complete' - name: Install GCC problem matcher uses: ammaraskar/gcc-problem-matcher@master diff --git a/.github/workflows/release-macos.yml b/.github/workflows/release-macos.yml index ce0b7adb40..9d7f09813a 100644 --- a/.github/workflows/release-macos.yml +++ b/.github/workflows/release-macos.yml @@ -41,6 +41,7 @@ jobs: uses: ./.github/actions/setup-vcpkg with: vcpkg-location: ${{ runner.temp }}/vcpkg + mono-install-command: 'brew install mono' - name: Install dependencies env: