Skip to content

Commit 7a1424c

Browse files
authored
build: Fix prepare-release.sh (#1094)
The prepare release script got out of sync with the actual code. - Automatically update the minor version in the readme - Cargo.toml version was moved in #1036
1 parent 7790799 commit 7a1424c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

prepare-release.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@ fi
1414

1515
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
1616
VERSION="$1"
17+
MINOR="$( echo ${VERSION} | cut -d\. -f1-2 )"
1718

1819
VERSION_MATCHER="([a-z0-9\\.-]+)"
1920
PROST_CRATE_MATCHER="(prost|prost-[a-z]+)"
2021

2122
# Update the README.md.
2223
sed -i -E "s/version = \"${VERSION_MATCHER}\"/version = \"${VERSION}\"/" "$DIR/README.md"
2324
sed -i -E "s/version = \"${VERSION_MATCHER}\"/version = \"${VERSION}\"/" "$DIR/prost/README.md"
25+
sed -i -E "s/${PROST_CRATE_MATCHER} = \"${VERSION_MATCHER}\"/\1 = \"${MINOR}\"/" "$DIR/README.md"
26+
sed -i -E "s/${PROST_CRATE_MATCHER} = \"${VERSION_MATCHER}\"/\1 = \"${MINOR}\"/" "$DIR/prost/README.md"
2427

2528
# Update html_root_url attributes.
2629
sed -i -E "s~html_root_url = \"https://docs\.rs/${PROST_CRATE_MATCHER}/$VERSION_MATCHER\"~html_root_url = \"https://docs.rs/\1/${VERSION}\"~" \
@@ -31,10 +34,7 @@ sed -i -E "s~html_root_url = \"https://docs\.rs/${PROST_CRATE_MATCHER}/$VERSION_
3134

3235
# Update Cargo.toml version fields.
3336
sed -i -E "s/^version = \"${VERSION_MATCHER}\"$/version = \"${VERSION}\"/" \
34-
"$DIR/prost/Cargo.toml" \
35-
"$DIR/prost-derive/Cargo.toml" \
36-
"$DIR/prost-build/Cargo.toml" \
37-
"$DIR/prost-types/Cargo.toml"
37+
"$DIR/Cargo.toml"
3838

3939
# Update Cargo.toml dependency versions.
4040
sed -i -E "s/^${PROST_CRATE_MATCHER} = \{ version = \"${VERSION_MATCHER}\"/\1 = { version = \"${VERSION}\"/" \

0 commit comments

Comments
 (0)