1717 BEVY_PATH : ${{ github.workspace }}/target/codegen/bevy
1818 OUTPUT_PATH : ${{ github.workspace }}/crates/bevy_mod_scripting_functions/src/bevy/
1919 BEVY_FEATURES : bevy_asset,bevy_animation,bevy_core_pipeline,bevy_ui,bevy_pbr,bevy_render,bevy_text,bevy_sprite,file_watcher,multi_threaded
20+ BRANCH_NAME : update-bevy-bindings-${{ github.run_id }}
2021jobs :
2122 generate_bindings :
2223 runs-on : ubuntu-latest
2324 steps :
2425 - name : Checkout
2526 uses : actions/checkout@v4
26- - name : Install toolchain
27+ - name : Setup Bot GitHub Credentials
28+ run : |
29+ git config user.name "github-actions[bot]"
30+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
31+ - name : Install Rust Toolchain
2732 uses : actions-rs/toolchain@v1
2833 with :
2934 toolchain : ${{ env.RUST_TOOLCHAIN }}
3035 components : rust-src, rustc-dev, llvm-tools-preview
3136 override : true
32- - name : Install bevy_api_gen binaries
37+ - name : Install bevy_api_gen Binaries
3338 run : cargo install --path ${{ env.BEVY_API_GEN_PATH }}
3439 - name : read bevy workspace version
3540 uses : SebRollen/toml-action@v1.2.0
@@ -46,19 +51,19 @@ jobs:
4651 git clone https://github.com/bevyengine/bevy --branch v${{ steps.read_toml.outputs.value }} --depth 1 ${{ env.BEVY_PATH }}
4752 cd ${{ env.BEVY_PATH }} && git fetch --tags && git checkout v${{ steps.read_toml.outputs.value }}
4853 ls -la ${{ env.BEVY_PATH }}
49- - name : Generate bevy bindings
54+ - name : Generate Bevy Bindings
5055 run : |
5156 cd ${{ env.BEVY_PATH }} && cargo bevy-api-gen generate --output ${{ env.OUTPUT_PATH }} --template-args '{ "self_is_bms_lua": true}' --features ${{ env.BEVY_FEATURES }} -vv
52- - name : Collect bevy bindings
57+ - name : Collect Bevy Bindings
5358 run : |
5459 ls -la ${{ env.BEVY_PATH }}
5560 cd ${{ env.BEVY_PATH }} && cargo bevy-api-gen collect --output ${{ env.OUTPUT_PATH }} --template-args '{ "self_is_bms_lua": true}'
56- - name : Commit changes
61+ - name : Commit Changes
5762 run : |
58- git checkout -b update-bevy-bindings- ${{ github.run_id }}
63+ git checkout -b ${{ env.BRANCH_NAME }} || git checkout ${{ env.BRANCH_NAME }}
5964 git add -A
6065 git commit -m "chore(codegen): update bevy bindings"
61- git push -u origin update-bevy-bindings- ${{ github.run_id }}
62- - name : Create PR
66+ git push -u origin ${{ env.BRANCH_NAME }} --force
67+ - name : Create Or Update PR
6368 run : |
64- gh pr create --title "chore(codegen): update bevy bindings" --body "This PR updates the bevy bindings" --base ${{ github.ref }} --head update-bevy-bindings-${{ github.run_id }}-$GITHUB_RUN_ATTEMPT
69+ gh pr create --title "chore(codegen): update bevy bindings" --body "This PR updates the bevy bindings" --base ${{ github.ref }} --head update-bevy-bindings-${{ github.run_id }}-$GITHUB_RUN_ATTEMPT || true
0 commit comments