-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (54 loc) · 2.51 KB
/
polkadot_version.yaml
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
56
57
58
59
60
61
62
63
---
name: Check Polkadot and Cumulus Update
on:
push:
schedule:
- cron: '0 0 * * *' # Runs at midnight UTC every day
jobs:
update-version:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install pyyaml requests
- name: Check for updates in Polkadot and replace version if needed
id: check-update-polkadot
run: |
python scripts/extract_version.py group_vars/polkadot.yaml default_client_version paritytech polkadot-sdk true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check for updates in Cumulus and replace version if needed
id: check-update-cumulus
run: |
python scripts/extract_version.py group_vars/cumulus.yaml default_client_version paritytech polkadot-sdk true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Git config
if: steps.check-update-polkadot.outputs.current_version != steps.check-update-polkadot.outputs.latest_release
|| steps.check-update-cumulus.outputs.current_version != steps.check-update-cumulus.outputs.latest_release
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Commit updated YAML files
if: steps.check-update-polkadot.outputs.current_version != steps.check-update-polkadot.outputs.latest_release
|| steps.check-update-cumulus.outputs.current_version != steps.check-update-cumulus.outputs.latest_release
run: |
git add group_vars/polkadot.yaml group_vars/cumulus.yaml
git commit -m "Update Polkadot and Cumulus versions"
git push
- name: Create Pull Request for Polkadot and Cumulus Update
if: steps.check-update-polkadot.outputs.current_version != steps.check-update-polkadot.outputs.latest_release
|| steps.check-update-cumulus.outputs.current_version != steps.check-update-cumulus.outputs.latest_release
uses: repo-sync/pull-request@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
pr_title: "Update Polkadot and Cumulus versions"
pr_body: "Automatically updated by GitHub Actions."
pr_label: "automated-pr"