Update VCPKG GHAs to use head commit id if variable isn't set (#574)

This commit is contained in:
Chuck Walbourn 2025-01-31 14:53:48 -08:00 committed by GitHub
parent 9303898a27
commit 6a2a13ee51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 72 additions and 4 deletions

View File

@ -81,11 +81,28 @@ jobs:
echo "::error Unknown architecture/build-type triplet mapping" echo "::error Unknown architecture/build-type triplet mapping"
} }
- name: Get vcpkg commit hash
shell: pwsh
run: |
if ($Env:vcpkgRelease) {
echo "Using vcpkg commit from repo variable..."
$VCPKG_COMMIT_ID = $Env:vcpkgRelease
}
else {
echo "Fetching latest vcpkg commit hash..."
$commit = (git ls-remote https://github.com/microsoft/vcpkg.git HEAD | Select-String -Pattern '([a-f0-9]{40})').Matches.Value
$VCPKG_COMMIT_ID = $commit
}
Write-Host "VCPKG_COMMIT_ID=$VCPKG_COMMIT_ID"
echo "VCPKG_COMMIT_ID=$VCPKG_COMMIT_ID" >> $env:GITHUB_ENV
env:
vcpkgRelease: '${{ vars.VCPKG_COMMIT_ID }}'
- uses: lukka/run-vcpkg@7d259227a1fb6471a0253dd5ab7419835228f7d7 # v11 - uses: lukka/run-vcpkg@7d259227a1fb6471a0253dd5ab7419835228f7d7 # v11
with: with:
runVcpkgInstall: true runVcpkgInstall: true
vcpkgJsonGlob: '**/build/vcpkg.json' vcpkgJsonGlob: '**/build/vcpkg.json'
vcpkgGitCommitId: '${{ vars.VCPKG_COMMIT_ID }}' vcpkgGitCommitId: '${{ env.VCPKG_COMMIT_ID }}'
- name: 'Configure CMake' - name: 'Configure CMake'
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}

View File

@ -121,11 +121,28 @@ jobs:
echo "::error Unknown architecture/build-type triplet mapping" echo "::error Unknown architecture/build-type triplet mapping"
} }
- name: Get vcpkg commit hash
shell: pwsh
run: |
if ($Env:vcpkgRelease) {
echo "Using vcpkg commit from repo variable..."
$VCPKG_COMMIT_ID = $Env:vcpkgRelease
}
else {
echo "Fetching latest vcpkg commit hash..."
$commit = (git ls-remote https://github.com/microsoft/vcpkg.git HEAD | Select-String -Pattern '([a-f0-9]{40})').Matches.Value
$VCPKG_COMMIT_ID = $commit
}
Write-Host "VCPKG_COMMIT_ID=$VCPKG_COMMIT_ID"
echo "VCPKG_COMMIT_ID=$VCPKG_COMMIT_ID" >> $env:GITHUB_ENV
env:
vcpkgRelease: '${{ vars.VCPKG_COMMIT_ID }}'
- uses: lukka/run-vcpkg@7d259227a1fb6471a0253dd5ab7419835228f7d7 # v11 - uses: lukka/run-vcpkg@7d259227a1fb6471a0253dd5ab7419835228f7d7 # v11
with: with:
runVcpkgInstall: true runVcpkgInstall: true
vcpkgJsonGlob: '**/build/vcpkg.json' vcpkgJsonGlob: '**/build/vcpkg.json'
vcpkgGitCommitId: '${{ vars.VCPKG_COMMIT_ID }}' vcpkgGitCommitId: '${{ env.VCPKG_COMMIT_ID }}'
- name: 'Configure CMake' - name: 'Configure CMake'
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}

View File

@ -93,11 +93,28 @@ jobs:
echo "::error Unknown architecture/build-type triplet mapping" echo "::error Unknown architecture/build-type triplet mapping"
} }
- name: Get vcpkg commit hash
shell: pwsh
run: |
if ($Env:vcpkgRelease) {
echo "Using vcpkg commit from repo variable..."
$VCPKG_COMMIT_ID = $Env:vcpkgRelease
}
else {
echo "Fetching latest vcpkg commit hash..."
$commit = (git ls-remote https://github.com/microsoft/vcpkg.git HEAD | Select-String -Pattern '([a-f0-9]{40})').Matches.Value
$VCPKG_COMMIT_ID = $commit
}
Write-Host "VCPKG_COMMIT_ID=$VCPKG_COMMIT_ID"
echo "VCPKG_COMMIT_ID=$VCPKG_COMMIT_ID" >> $env:GITHUB_ENV
env:
vcpkgRelease: '${{ vars.VCPKG_COMMIT_ID }}'
- uses: lukka/run-vcpkg@7d259227a1fb6471a0253dd5ab7419835228f7d7 # v11 - uses: lukka/run-vcpkg@7d259227a1fb6471a0253dd5ab7419835228f7d7 # v11
with: with:
runVcpkgInstall: true runVcpkgInstall: true
vcpkgJsonGlob: '**/build/vcpkg.json' vcpkgJsonGlob: '**/build/vcpkg.json'
vcpkgGitCommitId: '${{ vars.VCPKG_COMMIT_ID }}' vcpkgGitCommitId: '${{ env.VCPKG_COMMIT_ID }}'
- name: 'Configure CMake' - name: 'Configure CMake'
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}

View File

@ -37,11 +37,28 @@ jobs:
- uses: seanmiddleditch/gha-setup-ninja@96bed6edff20d1dd61ecff9b75cc519d516e6401 # v5 - uses: seanmiddleditch/gha-setup-ninja@96bed6edff20d1dd61ecff9b75cc519d516e6401 # v5
- name: Get vcpkg commit hash
shell: pwsh
run: |
if ($Env:vcpkgRelease) {
echo "Using vcpkg commit from repo variable..."
$VCPKG_COMMIT_ID = $Env:vcpkgRelease
}
else {
echo "Fetching latest vcpkg commit hash..."
$commit = (git ls-remote https://github.com/microsoft/vcpkg.git HEAD | Select-String -Pattern '([a-f0-9]{40})').Matches.Value
$VCPKG_COMMIT_ID = $commit
}
Write-Host "VCPKG_COMMIT_ID=$VCPKG_COMMIT_ID"
echo "VCPKG_COMMIT_ID=$VCPKG_COMMIT_ID" >> $env:GITHUB_ENV
env:
vcpkgRelease: '${{ vars.VCPKG_COMMIT_ID }}'
- uses: lukka/run-vcpkg@7d259227a1fb6471a0253dd5ab7419835228f7d7 # v11 - uses: lukka/run-vcpkg@7d259227a1fb6471a0253dd5ab7419835228f7d7 # v11
with: with:
runVcpkgInstall: true runVcpkgInstall: true
vcpkgJsonGlob: '**/build/vcpkg.json' vcpkgJsonGlob: '**/build/vcpkg.json'
vcpkgGitCommitId: '${{ vars.VCPKG_COMMIT_ID }}' vcpkgGitCommitId: '${{ env.VCPKG_COMMIT_ID }}'
- name: 'Configure CMake' - name: 'Configure CMake'
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}