-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
automation: automatic updates or Rust version (#87)
* automation: automatic updates or Rust version Use updatecli to automatically detect updates of Rust to be done inside of `rust-toolchain.toml`. Neither dependabot nor renovatebot can handle that. Signed-off-by: Flavio Castelli <[email protected]> * fix: updatecli manifest Signed-off-by: Olivier Vernin <[email protected]> --------- Signed-off-by: Flavio Castelli <[email protected]> Signed-off-by: Olivier Vernin <[email protected]> Co-authored-by: Olivier Vernin <[email protected]>
- Loading branch information
Showing
4 changed files
with
83 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,26 @@ | ||
name: Update rust-toolchain | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "30 3 * * 1" # 3:30 on Monday | ||
|
||
jobs: | ||
update-rust-toolchain: | ||
name: Update Rust toolchain | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | ||
|
||
- name: Install Updatecli in the runner | ||
uses: updatecli/updatecli-action@fa41baa922561b436c449de1a0bd1f5bd768248c # v2.58.0 | ||
|
||
- name: Update rust version inside of rust-toolchain file | ||
id: update_rust_toolchain | ||
env: | ||
UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
UPDATECLI_GITHUB_OWNER: ${{ github.repository_owner }} | ||
run: |- | ||
updatecli apply --config ./updatecli/updatecli.d/update-rust-toolchain.yaml \ | ||
--values updatecli/values.yaml |
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,6 @@ | ||
To test the updatecli manifests locally: | ||
|
||
```console | ||
export UPDATECLI_GITHUB_TOKEN=<your token> | ||
UPDATECLI_GITHUB_OWNER=<your user> updatecli diff --config updatecli/updatecli.d/update-rust-toolchain.yaml --values updatecli/values.yaml | ||
``` |
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,44 @@ | ||
name: Update Rust version inside of rust-toolchain file | ||
|
||
scms: | ||
github: | ||
kind: github | ||
spec: | ||
user: "{{ .github.author }}" | ||
email: "{{ .github.email }}" | ||
owner: "{{ requiredEnv .github.owner }}" | ||
repository: "wapc-rs" | ||
token: "{{ requiredEnv .github.token }}" | ||
username: "{{ requiredEnv .github.user }}" | ||
branch: "{{ .github.branch }}" | ||
commitmessage: | ||
hidecredit: true | ||
|
||
sources: | ||
rust-lang: | ||
name: Get the latest release of Rust from rust-lang | ||
kind: githubrelease | ||
spec: | ||
owner: rust-lang | ||
repository: rust | ||
token: "{{ requiredEnv .github.token }}" | ||
versionfilter: | ||
kind: semver | ||
pattern: "*" | ||
|
||
targets: | ||
dataFile: | ||
name: 'deps(rust): update Rust version to {{ source "rust-lang" }}' | ||
kind: toml | ||
scmid: github | ||
spec: | ||
file: "rust-toolchain.toml" | ||
key: toolchain.channel | ||
|
||
actions: | ||
default: | ||
kind: github/pullrequest | ||
scmid: github | ||
spec: | ||
labels: | ||
- chore |
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,7 @@ | ||
github: | ||
owner: "UPDATECLI_GITHUB_OWNER" | ||
token: "UPDATECLI_GITHUB_TOKEN" | ||
branch: "master" | ||
author: "updatecli bot" | ||
email: "[email protected]" | ||
user: "UPDATECLI_GITHUB_OWNER" |