Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Ensure both README are the same and prost version is correct #1078

Merged
merged 3 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- minimal-versions
- kani
- no-std
- check-readme
steps:
- run: exit 0

Expand Down Expand Up @@ -202,3 +203,15 @@ jobs:
# prost's default features to compile.
- name: prost-build check
run: cargo check --manifest-path prost-build/Cargo.toml

check-readme:
name: Check README
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify that both READMEs are identical
run: diff README.md prost/README.md

- name: Verify that Prost version is up to date in README
working-directory: prost
run: grep -q "$(sed '/^version = /!d' Cargo.toml | head -n1)" README.md
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,9 @@ the `std` features in `prost` and `prost-types`:

```ignore
[dependencies]
prost = { version = "0.6", default-features = false, features = ["prost-derive"] }
prost = { version = "0.12.6", default-features = false, features = ["prost-derive"] }
# Only necessary if using Protobuf well-known types:
prost-types = { version = "0.6", default-features = false }
prost-types = { version = "0.12.6", default-features = false }
```

Additionally, configure `prost-build` to output `BTreeMap`s instead of `HashMap`s
Expand Down
4 changes: 2 additions & 2 deletions prepare-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ fi

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

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

# Update the README.md.
sed -i -E "s/${PROST_CRATE_MATCHER} = \"${VERSION_MATCHER}\"/\1 = \"${MINOR}\"/" "$DIR/README.md"
sed -i -E "s/version = \"${VERSION_MATCHER}\"/version = \"${VERSION}\"/" "$DIR/README.md"
sed -i -E "s/version = \"${VERSION_MATCHER}\"/version = \"${VERSION}\"/" "$DIR/prost/README.md"

# Update html_root_url attributes.
sed -i -E "s~html_root_url = \"https://docs\.rs/${PROST_CRATE_MATCHER}/$VERSION_MATCHER\"~html_root_url = \"https://docs.rs/\1/${VERSION}\"~" \
Expand Down
4 changes: 2 additions & 2 deletions prost/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,9 @@ the `std` features in `prost` and `prost-types`:

```ignore
[dependencies]
prost = { version = "0.6", default-features = false, features = ["prost-derive"] }
prost = { version = "0.12.6", default-features = false, features = ["prost-derive"] }
# Only necessary if using Protobuf well-known types:
prost-types = { version = "0.6", default-features = false }
prost-types = { version = "0.12.6", default-features = false }
```

Additionally, configure `prost-build` to output `BTreeMap`s instead of `HashMap`s
Expand Down
Loading