mirror of https://github.com/rwf2/Rocket.git
Add script to automate publishing.
This commit is contained in:
parent
61a998f227
commit
de6de99caf
|
@ -22,3 +22,6 @@ _TODO
|
|||
|
||||
# The upload script, for now.
|
||||
scripts/upload-docs.sh
|
||||
|
||||
# Backup files.
|
||||
*.bak
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
#! /usr/bin/env bash
|
||||
set -e
|
||||
|
||||
#
|
||||
# Publishes the current versions of core, contrib, and codegen to crates.io.
|
||||
#
|
||||
|
||||
# Brings in: EXAMPLES_DIR, LIB_DIR, CODEGEN_DIR, CONTRIB_DIR, DOC_DIR
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
source $SCRIPT_DIR/config.sh
|
||||
|
||||
# Ensure everything passes before trying to publish.
|
||||
echo ":::: Running test suite..."
|
||||
cargo clean
|
||||
${SCRIPT_DIR}/test.sh
|
||||
|
||||
# Temporarily remove the dependency on codegen from core so crates.io verifies.
|
||||
sed -i.bak 's/rocket_codegen.*//' ${LIB_DIR}/Cargo.toml
|
||||
|
||||
# Publish all the things.
|
||||
for dir in "${LIB_DIR}" "${CODEGEN_DIR}" "${CONTRIB_DIR}"; do
|
||||
pushd ${dir}
|
||||
echo ":::: Publishing '${dir}..."
|
||||
# We already checked things ourselves. Don't spend time reverifying.
|
||||
cargo publish --no-verify
|
||||
popd
|
||||
done
|
||||
|
||||
# Restore the original core Cargo.toml.
|
||||
mv ${LIB_DIR}/Cargo.toml.bak ${LIB_DIR}/Cargo.toml
|
Loading…
Reference in New Issue