Skip to content

Commit

Permalink
Update check_vcpkg.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
tothxa authored Aug 10, 2024
1 parent d63bccd commit e98f7a1
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions .github/workflows/check_vcpkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,22 @@ jobs:
echo "result-${{ matrix.arch }}=true" >> $env:GITHUB_OUTPUT
update:
needs: vcpkg-packages
if: ${{ github.repository == 'widelands/widelands' && needs.vcpkg-packages.outputs.result-x64 && needs.vcpkg-packages.outputs.result-x86 }}
name: Commit new version
runs-on: windows-2022
if: ${{ github.repository == 'tothxa/widelands' && needs.vcpkg-packages.outputs.result-x64 && needs.vcpkg-packages.outputs.result-x86 }}
name: Update vcpkg_ref
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
persist-credentials: false
- name: Update vcpkg_ref
- name: Set variable
run: |
echo "Updating to ${{ needs.vcpkg-packages.outputs.vcpkg_ref }}"
echo "${{ needs.vcpkg-packages.outputs.vcpkg_ref }}" > .github/scripts/vcpkg_ref
if [ -n "$(git status -s)" ]; then
git config --global user.name "The Widelands Build Bot"
git config --global user.email "[email protected]"
git add .github/scripts/vcpkg_ref
git commit -m "Update vcpkg version"
git push "https://bunnybot:${{ secrets.WIDELANDS_FORMAT_TOKEN }}@github.com/${{ github.repository }}.git" master
if [ "${{ vars.VCPKG_REF }}" != "${{ needs.vcpkg-packages.outputs.vcpkg_ref }}" ] ; then
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: tothxa ${{ secrets.VARIABLES_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/tothxa/actions/variables/VCPKG_REF \
-d '{"name":"VCPKG_REF","value":"'"${{ needs.vcpkg-packages.outputs.vcpkg_ref }}"'"}'
else
echo "vcpkg_ref did not change"
fi
shell: bash

0 comments on commit e98f7a1

Please sign in to comment.