-
-
Notifications
You must be signed in to change notification settings - Fork 807
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to make sure CHANGELOG is always in sync with
__version__
(
#2297) * Add script to make sure CHANGELOG is always in sync with `__version__` * Fix version * Change file permission * Change head by sed
- Loading branch information
Showing
2 changed files
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh -e | ||
|
||
SEMVER_REGEX="([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?" | ||
CHANGELOG_VERSION=$(grep -o -E $SEMVER_REGEX CHANGELOG.md | sed -n 2p) | ||
VERSION=$(grep -o -E $SEMVER_REGEX httpx/__version__.py | head -1) | ||
echo "CHANGELOG_VERSION: $CHANGELOG_VERSION" | ||
echo "VERSION: $VERSION" | ||
if [ "$CHANGELOG_VERSION" != "$VERSION" ]; then | ||
echo "Version in changelog does not match version in httpx/__version__.py!" | ||
exit 1 | ||
fi |