Skip to content

Commit bd1edc4

Browse files
authored
ci: Add release-plz to CI (#58)
Update CI, msrv, labeler Updating Cargo dependencies. Prepare for new release
1 parent 80c2bf3 commit bd1edc4

File tree

12 files changed

+157
-374
lines changed

12 files changed

+157
-374
lines changed

.github/assets/msrv-badge.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
# Check for updates every Monday
6+
schedule:
7+
interval: "weekly"

.github/labeler.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
1-
changelog-updated:
1+
Documentation:
2+
- changed-files:
3+
- README.md
4+
5+
Changelog:
6+
- changed-files:
27
- CHANGELOG.md
38

4-
msrv-updated:
5-
- .github/assets/msrv-badge.svg
9+
CI:
10+
- changed-files:
11+
- any-glob-to-any-file:
12+
- .github/*
13+
14+
Configs:
15+
- changed-files:
16+
- Cargo.toml
17+
- cliff.toml
18+
- .gitignore
19+
20+
Examples:
21+
- changed-files:
22+
- any-glob-to-any-file:
23+
- examples/*
24+
25+
Source:
26+
- changed-files:
27+
- any-glob-to-any-file:
28+
- src/*
29+
30+
Tests:
31+
- changed-files:
32+
- any-glob-to-any-file:
33+
- tests/*
34+
35+
License:
36+
- changed-files:
37+
- LICENSE

.github/workflows/ci.yml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,4 @@ jobs:
3636
components: rustfmt, clippy
3737
- uses: Swatinem/rust-cache@v2
3838
- name: cargo check - ${{ matrix.cargo_checks.name }}
39-
run: cargo ${{ matrix.cargo_checks.subcommand }}
40-
41-
#update-project-stuff:
42-
# if: github.event_name == 'push' && github.ref == 'refs/heads/staging'
43-
# uses: ./.github/workflows/update-repo-stuff.yml
44-
# secrets: inherit
45-
46-
#done:
47-
# name: Done
48-
# if: github.event_name == 'push' && github.ref == 'refs/heads/staging'
49-
# needs:
50-
# - ci
51-
# - update-project-stuff
52-
# runs-on: ubuntu-latest
53-
# steps:
54-
# - name: Done
55-
# run: echo "Done!"
39+
run: cargo ${{ matrix.cargo_checks.subcommand }}

.github/workflows/publish.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/release-plz.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Release-plz
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
11+
# Release unpublished packages.
12+
release-plz-release:
13+
name: Release-plz release
14+
runs-on: ubuntu-latest
15+
if: ${{ github.repository_owner == 'tjtelan' }}
16+
permissions:
17+
contents: write
18+
steps:
19+
- &checkout
20+
name: Checkout repository
21+
uses: actions/checkout@v5
22+
with:
23+
fetch-depth: 0
24+
persist-credentials: true
25+
- &install-rust
26+
name: Install Rust toolchain
27+
uses: dtolnay/rust-toolchain@stable
28+
- name: Run release-plz
29+
uses: release-plz/[email protected]
30+
with:
31+
command: release
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
35+
36+
# Create a PR with the new versions and changelog, preparing the next release.
37+
release-plz-pr:
38+
name: Release-plz PR
39+
runs-on: ubuntu-latest
40+
if: ${{ github.repository_owner == 'tjtelan' }}
41+
permissions:
42+
contents: write
43+
pull-requests: write
44+
concurrency:
45+
group: release-plz-${{ github.ref }}
46+
cancel-in-progress: false
47+
steps:
48+
- *checkout
49+
- *install-rust
50+
- name: Run release-plz
51+
uses: release-plz/[email protected]
52+
id: release-plz
53+
with:
54+
command: release-pr
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
58+
- uses: Swatinem/rust-cache@v2
59+
- name: Install cargo-msrv and update MSRV in Cargo.toml
60+
timeout-minutes: 10
61+
run: |
62+
cargo install cargo-msrv
63+
cargo msrv find --write-msrv
64+
- name: Install cargo-rdme and update readme
65+
run: |
66+
cargo install cargo-rdme
67+
cargo rdme | true
68+
- name: Update msrv and/or readme in the release PR
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
PR: ${{ steps.release-plz.outputs.pr }}
72+
run: |
73+
set -e
74+
75+
pr_number=${{ fromJSON(steps.release-plz.outputs.pr).number }}
76+
if [[ -n "$pr_number" ]]; then
77+
gh pr checkout $pr_number
78+
# change "echo" with your commands
79+
git add .
80+
git commit -m "ci: Update msrv and/or readme"
81+
git push
82+
fi

.github/workflows/triage_pr.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ jobs:
1111
validate_pr_title:
1212
name: Validate PR title
1313
runs-on: ubuntu-latest
14+
permissions:
15+
pull-requests: read
1416
steps:
15-
- uses: amannn/action-semantic-pull-request@v4
17+
- uses: amannn/action-semantic-pull-request@v6
1618
env:
1719
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1820
with:
@@ -26,7 +28,7 @@ jobs:
2628
contents: read
2729
pull-requests: write
2830
steps:
29-
- uses: actions/labeler@v4
31+
- uses: actions/labeler@v6
3032
with:
3133
repo-token: "${{ secrets.GITHUB_TOKEN }}"
3234
sync-labels: true

0 commit comments

Comments
 (0)