1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-05-20 01:08:10 +00:00

update bump script to detect prerelease versions

This commit is contained in:
Rob Ede 2021-12-18 03:27:32 +00:00
parent 5c53db1e4d
commit d2b9724010
No known key found for this signature in database
GPG key ID: 97C636207D3EF933
2 changed files with 22 additions and 10 deletions

View file

@ -55,6 +55,11 @@ else
read -p "Update version to: " NEW_VERSION
fi
# strip leading v from input
if [ "${NEW_VERSION:0:1}" = "v" ]; then
NEW_VERSION="${NEW_VERSION:1}"
fi
DATE="$(date -u +"%Y-%m-%d")"
echo "updating from $CURRENT_VERSION => $NEW_VERSION ($DATE)"
@ -124,15 +129,20 @@ 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)"
if [ "$(echo $NEW_VERSION | grep beta)" ] || [ "$(echo $NEW_VERSION | grep rc)" ] || [ "$(echo $NEW_VERSION | grep alpha)" ]; then
PRERELEASE="--prerelease"
fi
echo
echo "GitHub release command:"
echo "gh release create \"$GIT_TAG\" --draft --title \"$RELEASE_TITLE\" --notes-file \"$CHANGE_CHUNK_FILE\" --prerelease"
GH_CMD="gh release create \"$GIT_TAG\" --draft --title \"$RELEASE_TITLE\" --notes-file \"$CHANGE_CHUNK_FILE\" ${PRERELEASE:-}"
echo "$GH_CMD"
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
eval "$GH_CMD"
fi
echo

View file

@ -486,19 +486,21 @@ where
#[cfg(test)]
mod tests {
use actix_service::Service;
use actix_service::Service as _;
use actix_utils::future::{err, ok};
use bytes::Bytes;
use super::*;
use crate::http::{
header::{self, HeaderValue},
Method, StatusCode,
use crate::{
http::{
header::{self, HeaderValue},
Method, StatusCode,
},
middleware::DefaultHeaders,
service::ServiceRequest,
test::{call_service, init_service, read_body, try_init_service, TestRequest},
web, HttpRequest, HttpResponse,
};
use crate::middleware::DefaultHeaders;
use crate::service::ServiceRequest;
use crate::test::{call_service, init_service, read_body, try_init_service, TestRequest};
use crate::{web, HttpRequest, HttpResponse};
#[actix_rt::test]
async fn test_default_resource() {