Revert releaser script to check working tree

because the release script commits the working tree contents of the
metadata files, not just what has been staged
This commit is contained in:
Andrew Ferrazzutti 2024-06-20 09:10:22 -04:00
parent 774b3483d3
commit 9ce847440f

View File

@ -7,19 +7,19 @@ then
exit 1
fi
VERSION=`jq -r .version <(git show :package.json)`
VERSION=`jq -r .version package.json`
function parseCargoVersion {
awk '$1 == "version" {gsub("\"", "", $3); print $3}' $1
}
CARGO_TOML_VERSION=`parseCargoVersion <(git show :Cargo.toml)`
CARGO_TOML_VERSION=`parseCargoVersion Cargo.toml`
if [[ $VERSION != $CARGO_TOML_VERSION ]]; then
echo "Node & Rust package versions do not match." >&2
echo "Node version (package.json): ${VERSION}" >&2
echo "Rust version (Cargo.toml): ${CARGO_TOML_VERSION}" >&2
exit 2
fi
CARGO_LOCK_VERSION=`parseCargoVersion <(grep -A1 matrix-hookshot <(git show :Cargo.lock))`
CARGO_LOCK_VERSION=`parseCargoVersion <(grep -A1 matrix-hookshot Cargo.lock)`
if [[ $CARGO_TOML_VERSION != $CARGO_LOCK_VERSION ]]; then
echo "Rust package version does not match the lockfile." >&2
echo "Rust version (Cargo.toml): ${CARGO_TOML_VERSION}" >&2
@ -40,7 +40,7 @@ if [ $(git tag -l "$TAG") ]; then
exit 5
fi
GIT_STATUS=$(git status --porcelain)
GIT_STATUS=$(git status --porcelain | grep -vE 'package.json|Cargo.(lock|toml)')
if [[ -n $GIT_STATUS ]]; then
echo "Uncommitted changes:"
echo $GIT_STATUS