Skip to content

Commit 0352751

Browse files
committed
update CI to use xtask for bindings
1 parent 8c5c9ed commit 0352751

File tree

13 files changed

+152
-1006
lines changed

13 files changed

+152
-1006
lines changed

.github/workflows/bevy_api_gen.yml

Lines changed: 0 additions & 145 deletions
This file was deleted.

.github/workflows/bevy_mod_scripting.yml

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ name: Check and Lint - bevy_mod_scripting
1717
env:
1818
REGISTRY: ghcr.io
1919
IMAGE_NAME: bevy-mod-scripting
20+
CODEGEN_BRANCH_NAME: __update-bevy-bindings-${{ github.head_ref || github.ref_name }}
2021

2122
concurrency:
2223
# Use github.run_id on main branch
@@ -99,4 +100,48 @@ jobs:
99100
if [[ -n $(git status -s) ]]; then
100101
git commit -m "chore(badge): Update coverage badge" -m "[skip ci]"
101102
git push
102-
fi
103+
fi
104+
generate_bindings:
105+
name: Bindings - Synchronise
106+
permissions:
107+
contents: write
108+
pull-requests: write
109+
runs-on: ubuntu-latest
110+
steps:
111+
- name: Checkout
112+
uses: actions/checkout@v4
113+
- name: Setup Bot GitHub Credentials
114+
run: |
115+
git config user.name "github-actions[bot]"
116+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
117+
- name: Setup
118+
run: |
119+
cargo xtask init
120+
- name: Generate Bindings
121+
run: |
122+
cargo xtask codegen
123+
- name: Check for changes
124+
id: check_changes
125+
run: |
126+
if [[ -n $(git status --porcelain) ]]; then
127+
echo "changes=true" >> "$GITHUB_OUTPUT";
128+
fi
129+
- name: Commit Changes
130+
if: steps.check_changes.outputs.changes
131+
run: |
132+
git checkout -b ${{ env.CODEGEN_BRANCH_NAME }} || git checkout ${{ env.CODEGEN_BRANCH_NAME }}
133+
git add -A
134+
git commit -m "chore(codegen): update bevy bindings"
135+
git push -u origin ${{ env.CODEGEN_BRANCH_NAME }} --force
136+
- uses: jwalton/gh-find-current-pr@master
137+
if: steps.check_changes.outputs.changes
138+
id: findPR
139+
with:
140+
state: all
141+
- name: Create Or Update PR
142+
if: steps.check_changes.outputs.changes && success() && steps.findPR.outputs.number
143+
run: |
144+
gh pr list --base feature/bevy-system-refactor --search "chore(codegen): update bevy bindings" --json number > prs.json
145+
if [ $(jq '. | length' prs.json) -eq 0 ]; then
146+
gh pr create --title "chore(codegen): update bevy bindings" --body "This PR updates the bevy bindings for #${{ steps.findPR.outputs.number }}" --base ${{ github.ref }} --head ${{ env.BRANCH_NAME }} || true
147+
fi

.github/workflows/generate_bindings.yml

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)