Update Dependencies #15
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |