Skip to content

Update dependencies #54

Update dependencies

Update dependencies #54

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 --offline
popd
done
- name: Create pull request
uses: peter-evans/create-pull-request@v6
with:
title: Update dependencies
commit-message: Update dependencies
token: ${{ secrets.REPO_TOKEN }}
branch-suffix: random