-
Notifications
You must be signed in to change notification settings - Fork 8
55 lines (50 loc) · 1.4 KB
/
idl-update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Update IDL
on:
schedule:
# every hour
- cron: '0 * * * *'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
program: [
circuit_breaker,
data_credits,
fanout,
helium_entity_manager,
helium_sub_daos,
hexboosting,
lazy_distributor,
lazy_transactions,
mobile_entity_manager,
price_oracle,
rewards_oracle,
treasury_management,
voter_stake_registry
]
max-parallel: 1
steps:
- uses: actions/checkout@v4
# the script replaces the json file with a newly downloaded one
# and updates the version in Cargo.toml
- name: Update IDLs
id: update-idls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG=$(.github/scripts/idl-update.sh ${{ matrix.program }})
if [ $? -ne 0 ]; then
echo "Failed to update IDLs: ${TAG}"
exit 1
fi
echo "${TAG}"
echo "TAG=${TAG}" >> "$GITHUB_ENV"
# creates a pull request with the updated idl
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
if: env.TAG != 'No updates found.'
with:
commit-message: "idl-update: ${{ env.TAG }}"
title: "idl-update: ${{ env.TAG }}"
branch: idl-update-${{ env.TAG }}