-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added automated Cargo.toml upgrade CI (#7)
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.
- Loading branch information
1 parent
1def7c6
commit 8409c72
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
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<<EOF' >> $GITHUB_OUTPUT | ||
echo cargo-upgrade upgrade --incompatible 2>&1 >> $GITHUB_OUTPUT | ||
echo 'EOF' >> $GITHUB_OUTPUT | ||
- 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 }} |