Skip to content

Commit

Permalink
Add a script to aid with releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlattimore committed Sep 7, 2023
1 parent 2be4ec8 commit 9c10142
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions scripts/release
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
set -e

if [ $(git diff HEAD --name-only | wc -l) -ne 0 ]; then
echo "Please commit all changes first" >&2
exit 1
fi

VERSION=$(grep ^version Cargo.toml | cut -d'"' -f2)
if ! head -1 RELEASE_NOTES.md | grep "# Version ${VERSION}$" >/dev/null; then
echo "RELEASE_NOTES.md doesn't have Version ${VERSION} at start" >&2
exit 1
fi

MIN_RUST_VER=$(grep ^rust-version Cargo.toml | cut -d'"' -f2)
if [ -z "$MIN_RUST_VER" ]; then
echo "Failed to determine minimum rust version" >&2
exit 1
fi

echo "Releasing version ${VERSION} with minimum rust version ${MIN_RUST_VER}"

cargo clippy -- -D warnings
cargo clippy --no-default-features -- -D warnings
cargo test
cargo run --release -- --save-requests --fail-on-warnings check
cargo +${MIN_RUST_VER}-x86_64-unknown-linux-gnu test --all

git tag v${VERSION}
git push origin
git push origin refs/tags/v${VERSION}

0 comments on commit 9c10142

Please sign in to comment.