-
Notifications
You must be signed in to change notification settings - Fork 14
155 lines (127 loc) · 4.45 KB
/
dependencies.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# Runs `cargo update` periodically.
name: Update Dependencies
on:
schedule:
# Run weekly
- cron: 0 0 * * MON
workflow_dispatch:
# Needed so we can run it manually
permissions:
checks: write
contents: write
pull-requests: write
jobs:
update-rust-deps:
name: Update
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: cargo-update
TITLE: "chore(deps): weekly `cargo update`"
BODY: |
Automation to keep dependencies in `Cargo.lock` current.
<details><summary><strong>cargo update log</strong></summary>
<p>
```log
$cargo_update_log
```
</p>
</details>
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: Cargo update
# Remove first line that always just says "Updating crates.io index"
run: |
cargo update --color never 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
- name: Craft commit message and PR body
id: msg
run: |
export cargo_update_log="$(cat cargo_update.log)"
echo "commit_message<<EOF" >> $GITHUB_OUTPUT
printf "$TITLE\n\n$cargo_update_log\n" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "body<<EOF" >> $GITHUB_OUTPUT
echo "$BODY" | envsubst >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- uses: actions/create-github-app-token@v1
id: github_token
with:
app-id: ${{ secrets.KAKAROT_BOT_APP_ID }}
private-key: ${{ secrets.KAKAROT_BOT_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.github_token.outputs.token }}
add-paths: ./Cargo.lock
commit-message: ${{ steps.msg.outputs.commit_message }}
title: ${{ env.TITLE }}
body: ${{ steps.msg.outputs.body }}
branch: ${{ env.BRANCH }}
delete-branch: true
update-python-deps:
name: Update
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: uv-update
TITLE: "chore(deps): update ethereum execution-specs"
BODY: |
Automation to keep ethereum execution-specs dependency up to date.
<details><summary><strong>uv update log</strong></summary>
<p>
```log
$uv_update_log
```
</p>
</details>
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: uv.lock
- name: Update ethereum execution-specs
id: update
run: |
LATEST_COMMIT=$(curl -s "https://api.github.com/repos/ethereum/execution-specs/commits/master" | jq -r .sha)
uv add ethereum@git+https://github.com/ethereum/execution-specs.git --rev $LATEST_COMMIT 2>&1 | tee -a uv_update.log
- name: Craft commit message and PR body
id: msg
run: |
export uv_update_log="$(cat uv_update.log)"
echo "commit_message<<EOF" >> $GITHUB_OUTPUT
printf "chore(deps): update ethereum execution-specs\n\n$uv_update_log\n" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "body<<EOF" >> $GITHUB_OUTPUT
echo "Automation to keep ethereum execution-specs dependency current.
<details><summary><strong>uv update log</strong></summary>
<p>
\`\`\`log
$uv_update_log
\`\`\`
</p>
</details>" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- uses: actions/create-github-app-token@v1
id: github_token
with:
app-id: ${{ secrets.KAKAROT_BOT_APP_ID }}
private-key: ${{ secrets.KAKAROT_BOT_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.github_token.outputs.token }}
add-paths: ./uv.lock
commit-message: ${{ steps.msg.outputs.commit_message }}
title: ${{ env.TITLE }}
body: ${{ steps.msg.outputs.body }}
branch: "${{ env.BRANCH }}"
labels: dependencies
delete-branch: true