File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333 rustup component add clippy rustfmt
3434 - name : Checkout repo
3535 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
36+ with :
37+ # This is needed to test that CHANGELOG.md is up-to-date.
38+ fetch-depth : 0
3639 # TODO(https://github.com/actions/cache/issues/1539): Just use actions/cache instead of the
3740 # work-around. The only relevant steps in-between are the cargo install commands.
3841 # BEGIN work-around
Original file line number Diff line number Diff line change 1515## 0.0.0
1616
1717No content.
18+
19+ <!-- Increment to skip CHANGELOG.md test: 0 -->
Original file line number Diff line number Diff line change 1616set -e
1717. ./color.sh
1818
19- info " Checking CHANGELOG.md version "
19+ info " Checking if CHANGELOG.md is up-to-date "
2020x=" $( sed -n ' 3s/^## //p' CHANGELOG.md) "
2121y=" $( sed -n ' 3s/^version = "\(.*\)"/\1/p' Cargo.toml) "
2222[ -n " $x " ] || error " Missing version in CHANGELOG.md"
2323[ -n " $y " ] || error " Missing version in Cargo.toml"
24- [ " $x " = " $y " ] || error " Version mismatch between Cargo.toml and CHANGELOG.md"
24+ [ " $x " = " $y " ] || error " CHANGELOG.md version differs from Cargo.toml"
25+ ref=$( git log -n1 --pretty=format:%H origin/main.. -- CHANGELOG.md)
26+ git diff --quiet ${ref:- origin/ main} -- Cargo.* src || error " CHANGELOG.md is not up-to-date"
2527
2628info " Running unit tests"
2729./test.sh
Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ info "Removing all -git suffixes"
2525sed -i ' s/-git//' Cargo.* CHANGELOG.md
2626VERSION=" ${VERSION% -git} "
2727
28+ info " Reset CHANGELOG.md counter"
29+ sed -i ' s/\(^<!-- .* test\): [0-9]* -->$/\1: 0 -->/' CHANGELOG.md
30+
2831info " Updating README.md"
2932sed -i ' s#\(releases/tag/cli/v\).*$#\1' " $VERSION " ' #' README.md
3033
You can’t perform that action at this time.
0 commit comments