dedupe changelog and remove git overrides

This commit is contained in:
Rob Ede 2021-11-30 14:04:42 +00:00
parent a20b3e36d9
commit bf9ec33fbc
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933
3 changed files with 111 additions and 19 deletions

View File

@ -152,14 +152,6 @@ awc = { path = "awc" }
# actix-tls = { path = "../actix-net/actix-tls" } # actix-tls = { path = "../actix-net/actix-tls" }
# actix-server = { path = "../actix-net/actix-server" } # actix-server = { path = "../actix-net/actix-server" }
actix-service = { git = "https://github.com/actix/actix-net.git", tag = "tls-v3.0.0-rc.1" }
actix-macros = { git = "https://github.com/actix/actix-net.git", tag = "tls-v3.0.0-rc.1" }
actix-rt = { git = "https://github.com/actix/actix-net.git", tag = "tls-v3.0.0-rc.1" }
actix-codec = { git = "https://github.com/actix/actix-net.git", tag = "tls-v3.0.0-rc.1" }
actix-utils = { git = "https://github.com/actix/actix-net.git", tag = "tls-v3.0.0-rc.1" }
actix-tls = { git = "https://github.com/actix/actix-net.git", tag = "tls-v3.0.0-rc.1" }
actix-server = { git = "https://github.com/actix/actix-net.git", tag = "tls-v3.0.0-rc.1" }
[[test]] [[test]]
name = "test_server" name = "test_server"
required-features = ["compress-brotli", "compress-gzip", "compress-zstd", "cookies"] required-features = ["compress-brotli", "compress-gzip", "compress-zstd", "cookies"]

View File

@ -15,17 +15,6 @@
[#2474]: https://github.com/actix/actix-web/pull/2474 [#2474]: https://github.com/actix/actix-web/pull/2474
### Changed
* Guarantee ordering of `header::GetAll` iterator to be same as insertion order. [#2467]
* Expose `header::map` module. [#2467]
* Implement `ExactSizeIterator` and `FusedIterator` for all `HeaderMap` iterators. [#2470]
* Update `actix-tls` to `3.0.0-rc.1`. [#2474]
[#2467]: https://github.com/actix/actix-web/pull/2467
[#2470]: https://github.com/actix/actix-web/pull/2470
[#2474]: https://github.com/actix/actix-web/pull/2474
## 3.0.0-beta.13 - 2021-11-22 ## 3.0.0-beta.13 - 2021-11-22
### Added ### Added
* `body::AnyBody::empty` for quickly creating an empty body. [#2446] * `body::AnyBody::empty` for quickly creating an empty body. [#2446]

111
scripts/bump Executable file
View File

@ -0,0 +1,111 @@
#!/bin/sh
# developed on macOS and probably doesn't work on Linux yet due to minor
# differences in flags on sed
# requires github cli tool for automatic release draft creation
set -euo pipefail
DIR=$1
LINUX=""
MACOS=""
if [ "$(uname)" = "Darwin" ]; then
MACOS="1"
fi
CARGO_MANIFEST=$DIR/Cargo.toml
CHANGELOG_FILE=$DIR/CHANGES.md
README_FILE=$DIR/README.md
# get current version
PACKAGE_NAME="$(sed -nE 's/^name ?= ?"([^"]+)"$/\1/ p' "$CARGO_MANIFEST" | head -n 1)"
CURRENT_VERSION="$(sed -nE 's/^version ?= ?"([^"]+)"$/\1/ p' "$CARGO_MANIFEST")"
CHANGE_CHUNK_FILE="$(mktemp)"
echo saving changelog to $CHANGE_CHUNK_FILE
echo
# get changelog chunk and save to temp file
cat "$CHANGELOG_FILE" |
# skip up to unreleased heading
sed '1,/Unreleased/ d' |
# take up to previous version heading
sed "/$CURRENT_VERSION/ q" |
# drop last line
sed '$d' \
>"$CHANGE_CHUNK_FILE"
# if word count of changelog chunk is 0 then insert filler changelog chunk
if [ "$(wc -w "$CHANGE_CHUNK_FILE" | awk '{ print $1 }')" = "0" ]; then
echo "* No significant changes since \`$CURRENT_VERSION\`." >"$CHANGE_CHUNK_FILE"
fi
if [ -n "${2-}" ]; then
NEW_VERSION="$2"
else
echo
echo "--- Changes since $CURRENT_VERSION ----"
cat "$CHANGE_CHUNK_FILE"
echo
read -p "Update version to: " NEW_VERSION
fi
DATE="$(date -u +"%Y-%m-%d")"
echo "updating from $CURRENT_VERSION => $NEW_VERSION ($DATE)"
# update package.version field
sed -i.bak -E "s/^version ?= ?\"[^\"]+\"$/version = \"$NEW_VERSION\"/" "$CARGO_MANIFEST"
# update readme
[ -f "$README_FILE" ] && sed -i.bak -E "s#$CURRENT_VERSION([/)])#$NEW_VERSION\1#g" "$README_FILE"
# update changelog file
(
sed '/Unreleased/ q' "$CHANGELOG_FILE" # up to unreleased heading
echo # blank line
echo # blank line
echo "## $NEW_VERSION - $DATE" # new version heading
cat "$CHANGE_CHUNK_FILE" # previously unreleased changes
sed "/$CURRENT_VERSION/ q" "$CHANGELOG_FILE" | tail -n 1 # the previous version heading
sed "1,/$CURRENT_VERSION/ d" "$CHANGELOG_FILE" # everything after previous version heading
) >"$CHANGELOG_FILE.bak"
mv "$CHANGELOG_FILE.bak" "$CHANGELOG_FILE"
# done; remove backup files
rm -f $CARGO_MANIFEST.bak
rm -f $CHANGELOG_FILE.bak
rm -f $README_FILE.bak
echo "manifest, changelog, and readme updated"
echo
echo "check other references:"
rg "$PACKAGE_NAME =" || true
rg "package = \"$PACKAGE_NAME\"" || true
if [ $MACOS ]; then
printf "prepare $PACKAGE_NAME release $NEW_VERSION" | pbcopy
else
echo
echo "commit message:"
echo "prepare $PACKAGE_NAME release $NEW_VERSION"
fi
SHORT_PACKAGE_NAME="$(echo $PACKAGE_NAME | sed 's/^actix-web-//' | sed 's/^actix-//')"
GIT_TAG="$(echo $SHORT_PACKAGE_NAME-v$NEW_VERSION)"
RELEASE_TITLE="$(echo $PACKAGE_NAME: v$NEW_VERSION)"
echo
echo "GitHub release command:"
echo "gh release create \"$GIT_TAG\" --draft --title \"$RELEASE_TITLE\" --notes-file \"$CHANGE_CHUNK_FILE\" --prerelease"
read -p "Submit draft GH release: (y/N) " GH_RELEASE
GH_RELEASE="${GH_RELEASE:-n}"
if [ "$GH_RELEASE" = 'y' ] || [ "$GH_RELEASE" = 'Y' ]; then
gh release create "$GIT_TAG" --draft --title "$RELEASE_TITLE" --notes-file "$CHANGE_CHUNK_FILE" --prerelease
fi
echo