forked from KhronosGroup/Vulkan-ValidationLayers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: Add autoroller to update_deps.py
- Loading branch information
1 parent
5807ddc
commit e3c87c5
Showing
2 changed files
with
113 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Header Update | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- main | ||
|
||
jobs: | ||
header-update: | ||
if: github.event_name == 'workflow_dispatch' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Update known-good | ||
id: update | ||
run: | | ||
python scripts/update_deps.py --no-build --dir external --roll-mode latest-tag --roll Vulkan-Headers Vulkan-Loader Vulkan-Utility-Libraries Vulkan-Tools | ||
echo HEADER_VERSION=$(jq -r '.["repos"][] | select(.name=="Vulkan-Headers").commit' scripts/known_good.json) >> $GITHUB_ENV | ||
grep -q -P '^v\d\.\d\.\d+$' <<< "$HEADER_VERSION" | ||
- name: Generate source | ||
id: generate | ||
continue-on-error: true | ||
run: | | ||
python scripts/generate_source.py external/Vulkan-Headers/registry external/SPIRV-Headers/include/spirv/unified1 | ||
python scripts/vk_validation_stats.py external/Vulkan-Headers/registry/validusage.json -spirvtools external/SPIRV-Tools -summary -c | ||
- name: Commit | ||
run: | | ||
git config user.name 'github-actions[bot]' | ||
git config user.email 'github-actions[bot]@users.noreply.github.com' | ||
git checkout -b gha-header-update-$HEADER_VERSION | ||
git commit -a -m "build: Update to header $HEADER_VERSION" | ||
git push --force origin gha-header-update-$HEADER_VERSION | ||
- name: Open PR | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh pr create --fill --body-file - << EOF | ||
### Update known-good.json | ||
~~~ | ||
${{join(steps.update.outputs.*, '\n')}} | ||
~~~ | ||
### Generate source | ||
~~~ | ||
${{join(steps.generate.outputs.*, '\n')}} | ||
~~~ | ||
header-tag:$HEADER_VERSION | ||
EOF | ||
header-tag: | ||
if: | | ||
github.event_name == 'pull_request' && | ||
github.event.pull_request.merged && | ||
contains(github.event.pull_request.body, 'header-tag:') | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: read | ||
steps: | ||
- name: Tag repo | ||
run: | | ||
HEADER_TAG=$(grep -oP 'header-tag:\K.*') <<< '${{github.event.pull_request.body}}' | ||
git tag $HEADER_TAG ${{github.event.pull_request.merge_commit_sha}} | ||
git push origin $HEADER_TAG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters