17
17
BEVY_PATH : ${{ github.workspace }}/target/codegen/bevy
18
18
OUTPUT_PATH : ${{ github.workspace }}/crates/bevy_mod_scripting_functions/src/bevy/
19
19
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 }}
20
21
jobs :
21
22
generate_bindings :
22
23
runs-on : ubuntu-latest
23
24
steps :
24
25
- name : Checkout
25
26
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
27
32
uses : actions-rs/toolchain@v1
28
33
with :
29
34
toolchain : ${{ env.RUST_TOOLCHAIN }}
30
35
components : rust-src, rustc-dev, llvm-tools-preview
31
36
override : true
32
- - name : Install bevy_api_gen binaries
37
+ - name : Install bevy_api_gen Binaries
33
38
run : cargo install --path ${{ env.BEVY_API_GEN_PATH }}
34
39
- name : read bevy workspace version
35
40
uses : SebRollen/toml-action@v1.2.0
@@ -46,19 +51,19 @@ jobs:
46
51
git clone https://github.com/bevyengine/bevy --branch v${{ steps.read_toml.outputs.value }} --depth 1 ${{ env.BEVY_PATH }}
47
52
cd ${{ env.BEVY_PATH }} && git fetch --tags && git checkout v${{ steps.read_toml.outputs.value }}
48
53
ls -la ${{ env.BEVY_PATH }}
49
- - name : Generate bevy bindings
54
+ - name : Generate Bevy Bindings
50
55
run : |
51
56
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
53
58
run : |
54
59
ls -la ${{ env.BEVY_PATH }}
55
60
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
57
62
run : |
58
- git checkout -b update-bevy-bindings- ${{ github.run_id }}
63
+ git checkout -b ${{ env.BRANCH_NAME }} || git checkout ${{ env.BRANCH_NAME }}
59
64
git add -A
60
65
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
63
68
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