Skip to content

Commit 5e5709a

Browse files
committed
Add update-annotations workflow
1 parent 805bc8f commit 5e5709a

File tree

3 files changed

+42
-8
lines changed

3 files changed

+42
-8
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ on:
44
push:
55
branches:
66
- main
7+
workflow_call:
78
workflow_dispatch:
89

910
jobs:
1011
build:
1112
name: Build
12-
runs-on: ubuntu-latest
13-
permissions:
14-
contents: write
13+
runs-on: ubuntu-22.04
1514
steps:
1615
- uses: actions/checkout@v4
1716
with:
@@ -20,6 +19,7 @@ jobs:
2019
with:
2120
bundler-cache: true
2221
- run: bundle exec rake
22+
# TODO: Improve testing.
2323
continue-on-error: true
2424
- name: Build annotations
2525
run: bundle exec rake build
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Update annotations
2+
3+
on:
4+
schedule:
5+
- cron: '0 12 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
run:
10+
name: Update annotations
11+
runs-on: ubuntu-22.04
12+
permissions:
13+
contents: write
14+
steps:
15+
- uses: ./.github/workflows/update-submodules.yml
16+
17+
- uses: ./.github/workflows/build.yml
18+
19+
- uses: actions/checkout@v4
20+
with:
21+
submodules: true
22+
23+
- name: Check if annotations changed
24+
id: annotations_changed
25+
run: echo "changed=$(git diff --quiet HEAD -- dist; echo $?)" >> $GITHUB_OUTPUT
26+
27+
- name: Setup git user
28+
if: ${{ steps.annotations_changed.outputs.changed == true }}
29+
run: |
30+
git config user.name github-actions
31+
git config user.email [email protected]
32+
- name: Commit changes
33+
if: ${{ steps.annotations_changed.outputs.changed == true }}
34+
run: |
35+
git add dfhack df-structures
36+
git commit -m "Auto-update annotations"
37+
git push

.github/workflows/update-submodules.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
name: Update submodules
22

3-
on:
4-
schedule:
5-
- cron: '0 12 * * *'
6-
workflow_dispatch:
3+
on: workflow_call
74

85
jobs:
96
run:
107
name: Update submodules
11-
runs-on: ubuntu-latest
8+
runs-on: ubuntu-22.04
129
permissions:
1310
contents: write
1411
steps:

0 commit comments

Comments
 (0)