Skip to content

Commit 069c992

Browse files
authored
Create regenerate-windows-sys.yml (#1094)
For automatically re-generate windows sys bindings and open a PR if necessary
1 parent e6e29d8 commit 069c992

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Regenerate windows sys bindings
2+
3+
on:
4+
workflow_dispatch: # Allow running on-demand
5+
schedule:
6+
- cron: '0 3 * * 5'
7+
8+
jobs:
9+
regenerate:
10+
name: Regenerate windows sys bindings & Open Pull Request if necessary
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
persist-credentials: true
16+
17+
- name: Generate branch name
18+
run: |
19+
git checkout -b regenerate-windows-sys-${{ github.run_id }}
20+
21+
- uses: Swatinem/rust-cache@v2
22+
- name: Regenerate windows sys bindings
23+
run: cargo run -p gen-windows-sys-binding
24+
25+
- name: Detect changes
26+
id: changes
27+
run:
28+
# This output boolean tells us if the dependencies have actually changed
29+
echo "count=$(git status --porcelain=v1 | wc -l)" >> $GITHUB_OUTPUT
30+
31+
- name: Commit and push changes
32+
# Only push if changes exist
33+
if: steps.changes.outputs.count > 0
34+
run: |
35+
git config user.name github-actions
36+
git config user.email [email protected]
37+
git commit -am "Regenerate windows sys bindings"
38+
git push origin HEAD
39+
40+
- name: Open pull request if needed
41+
if: steps.changes.outputs.count > 0
42+
env:
43+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
run: |
45+
gh pr create --base main --title "Regenerate windows sys bindings" --body "Automatically regenerated in CI"

0 commit comments

Comments
 (0)