diff --git a/.github/workflows/update-crate-versions.yml b/.github/workflows/update-crate-versions.yml deleted file mode 100644 index 62d910b..0000000 --- a/.github/workflows/update-crate-versions.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Update crates versions - -defaults: - run: - shell: bash - -on: - schedule: - # * is a special character in YAML, needs quoting - - cron: '0 0 * * 0' - workflow_dispatch: - -jobs: - updateversions: - runs-on: ubuntu-latest - container: - image: rust:latest - steps: - - name: Check out the code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Retrieve newest versions of dependencies - run: | - echo 'cargo_toml<> $GITHUB_ENV - ./bin/update-crates-versions.sh | sed 's/"/\\"/g' >> $GITHUB_ENV - echo 'EOF' >> $GITHUB_ENV - - name: Update Cargo.toml - run: - echo "${{env.cargo_toml}}" > local-registry/Cargo.toml - - name: Create Pull Request - id: cpr - uses: peter-evans/create-pull-request@v3 - with: - commit-message: Update crates versions - committer: GitHub - author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> - branch: update-crates-version - title: Update crates versions - body: | - Update crates versions - - This is an auto-generated pull request. \ No newline at end of file diff --git a/.github/workflows/update-crates-versions.yml b/.github/workflows/update-crates-versions.yml new file mode 100644 index 0000000..ad06a25 --- /dev/null +++ b/.github/workflows/update-crates-versions.yml @@ -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" \ No newline at end of file diff --git a/bin/update-crates-versions.sh b/bin/update-crates-versions.sh index 8d90072..f93aefb 100755 --- a/bin/update-crates-versions.sh +++ b/bin/update-crates-versions.sh @@ -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 \ No newline at end of file