From 7b5615cc20f0520fbdb0f2fe6580aceb70e06e57 Mon Sep 17 00:00:00 2001 From: Stefan Bossbaly Date: Sat, 20 Jul 2024 22:41:42 -0400 Subject: [PATCH] Added automated Cargo.toml upgrade CI Added the ability to automatically update the dependancies in the Cargo.toml file with the latest from crates.io. These upgrades are done weekly on Sunday at midnight. --- .github/workflows/update-dependancies.yml | 44 +++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/update-dependancies.yml diff --git a/.github/workflows/update-dependancies.yml b/.github/workflows/update-dependancies.yml new file mode 100644 index 0000000..276820d --- /dev/null +++ b/.github/workflows/update-dependancies.yml @@ -0,0 +1,44 @@ +on: + schedule: + - cron: "0 0 * * 0" + workflow_dispatch: + +name: Update Dependancies + +jobs: + update-dependancies: + runs-on: ubuntu-latest + steps: + - name: Timestamp Action + run: | + echo "NOW=$(date +'%Y-%m-%d-%I-%M-%S')" >> $GITHUB_OUTPUT + id: version + + - name: Checkout Source + uses: actions/checkout@v4 + + - name: Install Rust Toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Install Cargo Edit + run: | + cargo install -f cargo-edit + + - name: Update Rust Dependencies + id: update-rust-dependencies + run: | + cargo update + echo "CARGO_UPGRADE_OUTPUT=$(cargo-upgrade upgrade --incompatible)" >> $GITHUB_ENV + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + with: + add-paths: | + Cargo.toml + title: Update Dependancies + body: ${{ steps.update-rust-dependencies.outputs.CARGO_UPGRADE_OUTPUT }} + commit-message: ${{ steps.update-rust-dependencies.outputs.CARGO_UPGRADE_OUTPUT }} + assignees: StefanBossbaly + branch: update-dependancies-${{ steps.version.outputs.NOW }} + delete-branch: true + token: ${{ secrets.PAT_TOKEN }}