Skip to content

Commit

Permalink
Improve 'update crates' GH workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhovart committed Dec 9, 2021
1 parent d0fa219 commit 9402e68
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 45 deletions.
43 changes: 0 additions & 43 deletions .github/workflows/update-crate-versions.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/update-crates-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Update crates versions

defaults:
run:
shell: bash

on:
schedule:
# Every Sunday at 00:00
- cron: '0 0 * * 0'
workflow_dispatch:

jobs:
updateversions:
runs-on: ubuntu-latest
container:
image: rust:1.57.0
steps:
- name: Check out the code
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
with:
fetch-depth: 1
ref: main
- name: Retrieve newest versions of dependencies
run: ./bin/update-crates-versions.sh
- name: Create pull request
run: |
git checkout -b update-crates-versions
git add local-registry/Cargo.toml
git commit -m "Update crates versions"
gh pr create --title "Update crates versions" --body "This is an automated pull request"
2 changes: 0 additions & 2 deletions bin/update-crates-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ do
latest_version=$(cargo search "$crate" | head -n 1 | awk -F"[ ]+" '{print $1 " = " $3}')
sed -i -r "s/^$crate =.*/$latest_version/" $MANIFEST
done <<< "$DEPS"

cat $MANIFEST

0 comments on commit 9402e68

Please sign in to comment.