From 38056c0e3119bf83d692810f79c53bed7e04ddf4 Mon Sep 17 00:00:00 2001 From: Kevin Matthes <92332892+kevinmatthes@users.noreply.github.com> Date: Tue, 19 Sep 2023 22:41:35 +0200 Subject: [PATCH 01/15] Create .clippy.toml --- .clippy.toml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .clippy.toml diff --git a/.clippy.toml b/.clippy.toml new file mode 100644 index 0000000..3567239 --- /dev/null +++ b/.clippy.toml @@ -0,0 +1 @@ +msrv = "1.72.0" From b7c3a1a1e130a0216e18aefd2dfa5e44552c9519 Mon Sep 17 00:00:00 2001 From: Kevin Matthes <92332892+kevinmatthes@users.noreply.github.com> Date: Tue, 19 Sep 2023 22:42:57 +0200 Subject: [PATCH 02/15] Cargo.toml: pin MSRV to v1.72.0 --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index 782e2af..6fc9f28 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ homepage = "https://github.com/ttytm/wthrr-the-weathercrab" repository = "https://github.com/ttytm/wthrr-the-weathercrab" keywords = ["cli", "weather", "meteorological", "terminal"] categories = ["command-line-utilities"] +rust-version = "1.72.0" [dependencies] anyhow = "1.0" From c8c3f162d6623596a9d7bce7b8f2756275eafdb6 Mon Sep 17 00:00:00 2001 From: Kevin Matthes <92332892+kevinmatthes@users.noreply.github.com> Date: Tue, 19 Sep 2023 22:44:22 +0200 Subject: [PATCH 03/15] README: add MSRV badge --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index ef112cc..83f8fda 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,9 @@ last-commit + + msrv +
From d5aaa42216a43cef73720402ec3f59295c5e3c42 Mon Sep 17 00:00:00 2001 From: Kevin Matthes <92332892+kevinmatthes@users.noreply.github.com> Date: Mon, 9 Oct 2023 19:58:46 +0200 Subject: [PATCH 04/15] README: adjust badges --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 83f8fda..ffb46e0 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ # 🦀 wthrr-the-weathercrab
- - crates.io - build-status last-commit + + crates.io + - msrv + msrv

From f899f3000ba59d0ec242300885972ebcd4543e75 Mon Sep 17 00:00:00 2001 From: Kevin Matthes <92332892+kevinmatthes@users.noreply.github.com> Date: Tue, 10 Oct 2023 22:46:41 +0200 Subject: [PATCH 05/15] CI: check whether the MSRV would change --- .github/workflows/pr.yml | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..c051e85 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,41 @@ +name: pr + +on: + pull_request: + +permissions: + pull-requests: write + +jobs: + msrv-changes: + runs-on: ubuntu-latest + steps: + - uses: baptiste0928/cargo-install@v2.2.0 + with: + crate: cargo-msrv + + - uses: actions/checkout@v4.0.0 + with: + ref: ${{ github.head_ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + + - id: msrv + run: | + cargo msrv list 2> result.txt + echo 'The MSRV will not change.' > message.md + echo "new=$( \ + egrep [[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+ result.txt \ + | tail -n 1 \ + | cut -d \ -f 2\ + )" + echo "current=$(cat .clippy.toml | cut -d \" -f 2)" + + - if: steps.msrv.outputs.new != steps.msrv.outputs.current + run: | + echo 'Please update the MSRV to ${{ steps.msrv.outputs.new }}.' \ + > message.md + + - uses: thollander/actions-comment-pull-request@v2.4.2 + with: + comment_tag: msrv-changes + filePath: message.md From 815083d6b43afecdd02c14c8aadb3feba2ae8315 Mon Sep 17 00:00:00 2001 From: Kevin Matthes <92332892+kevinmatthes@users.noreply.github.com> Date: Tue, 10 Oct 2023 22:55:20 +0200 Subject: [PATCH 06/15] CI: fix stylistic issues in new workflow --- .github/workflows/pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c051e85..12958d1 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -24,11 +24,11 @@ jobs: cargo msrv list 2> result.txt echo 'The MSRV will not change.' > message.md echo "new=$( \ - egrep [[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+ result.txt \ + grep -E [[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+ result.txt \ | tail -n 1 \ | cut -d \ -f 2\ )" - echo "current=$(cat .clippy.toml | cut -d \" -f 2)" + echo "current=$(cut -d \" -f 2 < .clippy.toml)" - if: steps.msrv.outputs.new != steps.msrv.outputs.current run: | From 1bc25eb9be663d16e2f32a3be6e32c5b22decf2c Mon Sep 17 00:00:00 2001 From: Kevin Matthes <92332892+kevinmatthes@users.noreply.github.com> Date: Tue, 10 Oct 2023 22:58:46 +0200 Subject: [PATCH 07/15] CI: quote `grep` pattern --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 12958d1..c99aee0 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -24,7 +24,7 @@ jobs: cargo msrv list 2> result.txt echo 'The MSRV will not change.' > message.md echo "new=$( \ - grep -E [[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+ result.txt \ + grep -E '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+' result.txt \ | tail -n 1 \ | cut -d \ -f 2\ )" From 1f3e38d417ebafa06505ffed1698cc686b8be535 Mon Sep 17 00:00:00 2001 From: Kevin Matthes <92332892+kevinmatthes@users.noreply.github.com> Date: Tue, 10 Oct 2023 23:09:05 +0200 Subject: [PATCH 08/15] Update pr.yml --- .github/workflows/pr.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c99aee0..5a57cf9 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -23,12 +23,8 @@ jobs: run: | cargo msrv list 2> result.txt echo 'The MSRV will not change.' > message.md - echo "new=$( \ - grep -E '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+' result.txt \ - | tail -n 1 \ - | cut -d \ -f 2\ - )" - echo "current=$(cut -d \" -f 2 < .clippy.toml)" + echo "new=$(grep -E '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+' result.txt | tail -n 1 | cut -d \ -f 2)" >> "$GITHUB_OUTPUT" + echo "current=$(cut -d \" -f 2 < .clippy.toml)" >> "$GITHUB_OUTPUT" - if: steps.msrv.outputs.new != steps.msrv.outputs.current run: | From 0d104fe39da2a5769d609c3707476f3976fb66d0 Mon Sep 17 00:00:00 2001 From: Kevin Matthes <92332892+kevinmatthes@users.noreply.github.com> Date: Tue, 10 Oct 2023 23:16:42 +0200 Subject: [PATCH 09/15] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 12925f4..bd17899 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ # 🦀 wthrr-the-weathercrab -[![][crates_io_shield]](https://crates.io/crates/wthrr) [![][ci_shield]](https://github.com/ttytm/wthrr-the-weathercrab/actions/workflows/ci.yml?query=branch%3Amain) [![][last_commit_shield]](https://github.com/ttytm/wthrr-the-weathercrab/commits/main) +[![][crates_io_shield]](https://crates.io/crates/wthrr) +[![][msrv_shield]](https://github.com/ttytm/wthrr-the-weathercrab)
@@ -188,9 +189,10 @@ A simple changelog can be found on the [releases page](https://github.com/ttytm/ [preview]: https://github.com/ttytm/wthrr-the-weathercrab/assets/34311583/58780205-816b-4cfd-95f8-9453e754eb94 -[crates_io_shield]: https://img.shields.io/crates/v/wthrr?style=flat-square +[crates_io_shield]: https://img.shields.io/crates/v/wthrr?style=flat-square&color=DEA584 [ci_shield]: https://img.shields.io/github/actions/workflow/status/ttytm/wthrr-the-weathercrab/ci.yml?branch=main&style=flat-square [last_commit_shield]: https://img.shields.io/github/last-commit/ttytm/wthrr-the-weathercrab?style=flat-square +[msrv_shield]: https://img.shields.io/badge/MSRV-1.70.0-DEA584?style=flat-square [first_run]: https://user-images.githubusercontent.com/34311583/219735581-8036590f-8354-47fb-a31f-055be79c9229.png [hourly_forecast]: https://user-images.githubusercontent.com/34311583/219735474-d8e2899d-c209-46d3-a5cd-bea4ed41ac3c.png [weekly_forecast]: https://user-images.githubusercontent.com/34311583/219735452-9766d692-a79b-4a5a-a903-30a3339cc684.png From 38c0fa8a5bd14e23bd58a50fbad618118277d005 Mon Sep 17 00:00:00 2001 From: Kevin Matthes <92332892+kevinmatthes@users.noreply.github.com> Date: Tue, 10 Oct 2023 23:17:57 +0200 Subject: [PATCH 10/15] Cargo.toml: set MSRV to v1.70.0 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 79269f3..7c97f6a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ homepage = "https://github.com/ttytm/wthrr-the-weathercrab" repository = "https://github.com/ttytm/wthrr-the-weathercrab" keywords = ["cli", "weather", "meteorological", "terminal"] categories = ["command-line-utilities"] -rust-version = "1.72.0" +rust-version = "1.70.0" [dependencies] anyhow = "1.0" From d904446abe2c53698e5cb68be35227400eda3948 Mon Sep 17 00:00:00 2001 From: Kevin Matthes <92332892+kevinmatthes@users.noreply.github.com> Date: Tue, 10 Oct 2023 23:18:27 +0200 Subject: [PATCH 11/15] .clippy.toml: set MSRV to v1.70.0 --- .clippy.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.clippy.toml b/.clippy.toml index 3567239..1645c19 100644 --- a/.clippy.toml +++ b/.clippy.toml @@ -1 +1 @@ -msrv = "1.72.0" +msrv = "1.70.0" From ba4aa298a726473e87990c9e941e50a44be899b0 Mon Sep 17 00:00:00 2001 From: Kevin Matthes <92332892+kevinmatthes@users.noreply.github.com> Date: Tue, 10 Oct 2023 23:25:32 +0200 Subject: [PATCH 12/15] Update pr.yml --- .github/workflows/pr.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5a57cf9..b484b68 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -10,26 +10,24 @@ jobs: msrv-changes: runs-on: ubuntu-latest steps: - - uses: baptiste0928/cargo-install@v2.2.0 - with: - crate: cargo-msrv - - uses: actions/checkout@v4.0.0 with: ref: ${{ github.head_ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} + - uses: baptiste0928/cargo-install@v2.2.0 + with: + crate: cargo-msrv + - id: msrv run: | cargo msrv list 2> result.txt echo 'The MSRV will not change.' > message.md - echo "new=$(grep -E '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+' result.txt | tail -n 1 | cut -d \ -f 2)" >> "$GITHUB_OUTPUT" - echo "current=$(cut -d \" -f 2 < .clippy.toml)" >> "$GITHUB_OUTPUT" + echo "new_msrv=$(grep -E '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+' result.txt | tail -n 1 | cut -d ' ' -f 2)" # >> "$GITHUB_OUTPUT" + echo "current_msrv=$(cut -d \" -f 2 < .clippy.toml)" # >> "$GITHUB_OUTPUT" - - if: steps.msrv.outputs.new != steps.msrv.outputs.current - run: | - echo 'Please update the MSRV to ${{ steps.msrv.outputs.new }}.' \ - > message.md + - if: steps.msrv.outputs.new_msrv != steps.msrv.outputs.current_msrv + run: echo 'Please update the MSRV to ${{ steps.msrv.outputs.new_msrv }}.' > message.md - uses: thollander/actions-comment-pull-request@v2.4.2 with: From cba4d046a7a74cb70a734564c4c1a2cfe6e2e5a4 Mon Sep 17 00:00:00 2001 From: Kevin Matthes <92332892+kevinmatthes@users.noreply.github.com> Date: Tue, 10 Oct 2023 23:31:47 +0200 Subject: [PATCH 13/15] Update pr.yml --- .github/workflows/pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index b484b68..1076a28 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -4,6 +4,7 @@ on: pull_request: permissions: + contents: read pull-requests: write jobs: From 8dc671ad6b8c706552461ed286042388836b70a1 Mon Sep 17 00:00:00 2001 From: Kevin Matthes <92332892+kevinmatthes@users.noreply.github.com> Date: Tue, 10 Oct 2023 23:36:22 +0200 Subject: [PATCH 14/15] Update pr.yml --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 1076a28..cf166da 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -22,7 +22,7 @@ jobs: - id: msrv run: | - cargo msrv list 2> result.txt + cargo msrv list > result.txt echo 'The MSRV will not change.' > message.md echo "new_msrv=$(grep -E '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+' result.txt | tail -n 1 | cut -d ' ' -f 2)" # >> "$GITHUB_OUTPUT" echo "current_msrv=$(cut -d \" -f 2 < .clippy.toml)" # >> "$GITHUB_OUTPUT" From 03b663720526aedefbbd04d592d5604a530e7799 Mon Sep 17 00:00:00 2001 From: Kevin Matthes <92332892+kevinmatthes@users.noreply.github.com> Date: Tue, 10 Oct 2023 23:37:15 +0200 Subject: [PATCH 15/15] Delete .github/workflows/pr.yml --- .github/workflows/pr.yml | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml deleted file mode 100644 index cf166da..0000000 --- a/.github/workflows/pr.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: pr - -on: - pull_request: - -permissions: - contents: read - pull-requests: write - -jobs: - msrv-changes: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4.0.0 - with: - ref: ${{ github.head_ref }} - repository: ${{ github.event.pull_request.head.repo.full_name }} - - - uses: baptiste0928/cargo-install@v2.2.0 - with: - crate: cargo-msrv - - - id: msrv - run: | - cargo msrv list > result.txt - echo 'The MSRV will not change.' > message.md - echo "new_msrv=$(grep -E '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+' result.txt | tail -n 1 | cut -d ' ' -f 2)" # >> "$GITHUB_OUTPUT" - echo "current_msrv=$(cut -d \" -f 2 < .clippy.toml)" # >> "$GITHUB_OUTPUT" - - - if: steps.msrv.outputs.new_msrv != steps.msrv.outputs.current_msrv - run: echo 'Please update the MSRV to ${{ steps.msrv.outputs.new_msrv }}.' > message.md - - - uses: thollander/actions-comment-pull-request@v2.4.2 - with: - comment_tag: msrv-changes - filePath: message.md