Update dependencies #135
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
name: Update dependencies | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "30 1 * * Mon" | |
jobs: | |
update: | |
runs-on: ubuntu-20.04 | |
container: ghcr.io/dfinity/dre/actions-runner:3dd4f38f076cad73fdcc68ad37fd29bed4fa3e4d | |
steps: | |
- name: Create GitHub App Token | |
uses: actions/create-github-app-token@v1 | |
id: app-token | |
with: | |
app-id: ${{ vars.PR_AUTOMATION_BOT_PUBLIC_APP_ID }} | |
private-key: ${{ secrets.PR_AUTOMATION_BOT_PUBLIC_PRIVATE_KEY }} | |
- uses: actions/checkout@v4 | |
- name: "🔧 Setup runner" | |
uses: ./.github/workflows/manage-runner-pre | |
######################################## | |
# Once per night, update dependencies and completely delete and recreate bazel cache | |
######################################## | |
- name: "⚒️ Run autoupdate for ic-deps" | |
run: | | |
rye sync | |
rye run python3 scripts/auto-update-revisions.py | |
- name: "⚒️ Completely delete bazel cache and then recreate it" | |
run: | | |
# https://github.com/rustls/rustls/issues/1967#issuecomment-2279067420 | |
sudo apt remove gcc-9 -y | |
sudo apt install clang -y | |
cargo install cargo-upgrades | |
cargo install cargo-edit | |
cargo upgrade --recursive | |
# Install taplo cli | |
TAPLO=taplo-linux-x86_64 | |
curl -L "https://github.com/tamasfe/taplo/releases/latest/download/$TAPLO.gz" -O | |
gunzip $TAPLO.gz | |
chmod +x ./$TAPLO | |
OTEL_VER=$(./$TAPLO get -f Cargo.lock -o json | jq '.package[] | select(.name == "axum-otel-metrics")'| grep -oP '"opentelemetry\s\K[\d.]+' || echo "") | |
if [[ -n "$OTEL_VER" ]]; then | |
cargo upgrade --package opentelemetry@$OTEL_VER | |
fi | |
rm ./$TAPLO | |
# Reinstall gcc | |
sudo apt install gcc -y | |
CARGO_BAZEL_REPIN=true bazel query >/dev/null | |
./bin/release-controller-update-data-model.sh | |
- name: "🆕 Create a new Pull Request with the changes" | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
commit-message: "chore: Update dependencies" | |
branch: bot-update-deps | |
title: "chore: Update dependencies" | |
body: "This PR updates Python, Rust crates, and IC repository dependencies" | |
token: ${{ steps.app-token.outputs.token }} | |
- name: "🪓 Tear down runner" | |
uses: ./.github/workflows/manage-runner-post |