-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into dp-all-requests-timeout
* master: (21 commits) New proc macro (#387) Streaming RpcParams parsing (#401) Set allowed Host header values (#399) Synchronization-less async connections in ws-server (#388) [ws server]: terminate already established connection(s) when the server is stopped (#396) feat: customizable JSON-RPC error codes via new enum variant on `CallErrror` (#394) [ci]: test each individual crate's manifest (#392) Add a way to stop servers (#386) [jsonrpsee types]: unify a couple of types + more tests (#389) Update roadmap link in readme (#390) Cross-origin protection (#375) Method aliases + RpcModule: Clone (#383) Use criterion's async bencher (#385) Async/subscription benches (#372) send text (#374) Fix link to ws server in README.md (#373) Concat -> simple push (#370) Add missing `rt` feature (#369) Release prep for v0.2 (#368) chore(scripts): publish script (#354) ...
- Loading branch information
Showing
80 changed files
with
3,060 additions
and
534 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,96 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# This script is copied from `https://github.com/paritytech/jsonrpc` with some minor tweaks. | ||
|
||
set -eu | ||
|
||
ORDER=(types proc-macros utils http-client http-server ws-client ws-server jsonrpsee) | ||
|
||
function read_toml () { | ||
NAME="" | ||
VERSION="" | ||
NAME=$(grep "^name" ./Cargo.toml | sed -e 's/.*"\(.*\)"/\1/') | ||
VERSION=$(grep "^version" ./Cargo.toml | sed -e 's/.*"\(.*\)"/\1/') | ||
} | ||
function remote_version () { | ||
REMOTE_VERSION="" | ||
REMOTE_VERSION=$(cargo search "$NAME" | grep "^$NAME =" | sed -e 's/.*"\(.*\)".*/\1/') | ||
} | ||
|
||
# First display the plan | ||
for CRATE_DIR in ${ORDER[@]}; do | ||
cd $CRATE_DIR > /dev/null | ||
read_toml | ||
echo "$NAME@$VERSION" | ||
cd - > /dev/null | ||
done | ||
|
||
read -p ">>>> Really publish?. Press [enter] to continue. " | ||
|
||
set -x | ||
|
||
cargo clean | ||
|
||
set +x | ||
|
||
# Then actually perform publishing. | ||
for CRATE_DIR in ${ORDER[@]}; do | ||
cd $CRATE_DIR > /dev/null | ||
read_toml | ||
remote_version | ||
# Seems the latest version matches, skip by default. | ||
if [ "$REMOTE_VERSION" = "$VERSION" ] || [[ "$REMOTE_VERSION" > "$VERSION" ]]; then | ||
RET="" | ||
echo "Seems like $NAME@$REMOTE_VERSION is already published. Continuing in 5s. " | ||
read -t 5 -p ">>>> Type [r][enter] to retry, or [enter] to continue... " RET || true | ||
if [ "$RET" != "r" ]; then | ||
echo "Skipping $NAME@$VERSION" | ||
cd - > /dev/null | ||
continue | ||
fi | ||
fi | ||
|
||
# Attempt to publish (allow retries) | ||
while : ; do | ||
# give the user an opportunity to abort or skip before publishing | ||
echo "🚀 Publishing $NAME@$VERSION..." | ||
sleep 3 | ||
|
||
set +e && set -x | ||
cargo publish $@ | ||
RES=$? | ||
set +x && set -e | ||
# Check if it succeeded | ||
if [ "$RES" != "0" ]; then | ||
CHOICE="" | ||
echo "##### Publishing $NAME failed" | ||
read -p ">>>>> Type [s][enter] to skip, or [enter] to retry.. " CHOICE | ||
if [ "$CHOICE" = "s" ]; then | ||
break | ||
fi | ||
else | ||
break | ||
fi | ||
done | ||
|
||
# Wait again to make sure that the new version is published and available. | ||
echo "Waiting for $NAME@$VERSION to become available at the registry..." | ||
while : ; do | ||
sleep 3 | ||
remote_version | ||
if [ "$REMOTE_VERSION" = "$VERSION" ]; then | ||
echo "🥳 $NAME@$VERSION published succesfully." | ||
sleep 3 | ||
break | ||
else | ||
echo "#### Got $NAME@$REMOTE_VERSION but expected $NAME@$VERSION. Retrying..." | ||
fi | ||
done | ||
cd - > /dev/null | ||
done | ||
|
||
echo "Tagging jsonrpsee@$VERSION" | ||
set -x | ||
git tag -a v$VERSION -m "Version $VERSION" | ||
sleep 3 | ||
git push --tags |
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
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
Oops, something went wrong.