Update dependencies #63
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 | |
# smoelius: Every Monday at 3:00 UTC (Sunday at 22:00 EST), create a PR to update dependencies to | |
# their latest patch versions. | |
# | |
# The main purpose of this action is verify that the project's lockfiles aren't needed to build it | |
# (hence, the `rm -f Cargo.lock` below). However, doing so produces up-to-date lockfiles as a | |
# by-product. From there, `cargo upgrade` can be used to make the `Cargo.toml` files match. So, | |
# given that we have these up-to-date `Cargo.lock` and `Cargo.toml` files, why not create a PR? | |
on: | |
schedule: | |
- cron: 0 3 * * 1 | |
workflow_dispatch: | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs | |
# https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#push-using-ssh-deploy-keys | |
ssh-key: ${{ secrets.SSH_KEY }} | |
- name: Install cargo-edit | |
run: cargo install cargo-edit | |
- name: Install dylint-link | |
run: cargo install --path ./dylint-link | |
- name: Free up space | |
run: | | |
# https://github.com/actions/runner-images/issues/2606#issuecomment-772683150 | |
sudo rm -rf /usr/local/lib/android | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /usr/share/swift | |
- name: Update dependencies | |
run: | | |
find . -name Cargo.lock | while read -r X; do | |
pushd "$(dirname "$X")" | |
rm -f Cargo.lock | |
cargo build --all-targets | |
cargo upgrade | |
popd | |
done | |
- name: Create pull request | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
title: Update dependencies | |
branch: update-dependencies | |
branch-suffix: random | |
commit-message: Update dependencies | |
token: ${{ secrets.REPO_TOKEN }} |