mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 21:19:13 +00:00
Update release script (#819)
* Update releaser script to check Cargo.toml version * Update releaser script to check Cargo.lock version * Update Cargo.toml/lock * Let releaser script show actual branch to be on * Echo releaser script errors to stderr * Use unique exit codes for releaser script errors * Add changelog
This commit is contained in:
parent
f88ee8e95b
commit
4a1c449154
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -727,7 +727,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "matrix-hookshot"
|
name = "matrix-hookshot"
|
||||||
version = "4.4.1"
|
version = "4.5.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atom_syndication",
|
"atom_syndication",
|
||||||
"contrast",
|
"contrast",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "matrix-hookshot"
|
name = "matrix-hookshot"
|
||||||
version = "4.5.0"
|
version = "4.5.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
|
1
changelog.d/819.misc
Normal file
1
changelog.d/819.misc
Normal file
@ -0,0 +1 @@
|
|||||||
|
Update the release script to check for consistency between Node & Rust package versions.
|
@ -3,23 +3,41 @@
|
|||||||
|
|
||||||
if ! command -v jq &> /dev/null
|
if ! command -v jq &> /dev/null
|
||||||
then
|
then
|
||||||
echo "You must install jq to use this script"
|
echo "You must install jq to use this script" >&2
|
||||||
exit
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
VERSION=`jq -r .version package.json`
|
VERSION=`jq -r .version package.json`
|
||||||
|
|
||||||
|
function parseCargoVersion {
|
||||||
|
awk '$1 == "version" {gsub("\"", "", $3); print $3}' $1
|
||||||
|
}
|
||||||
|
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 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
|
||||||
|
echo "Lockfile version (Cargo.lock): ${CARGO_LOCK_VERSION}" >&2
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
TAG="$VERSION"
|
TAG="$VERSION"
|
||||||
HEAD_BRANCH=`git remote show origin | sed -n '/HEAD branch/s/.*: //p'`
|
HEAD_BRANCH=`git remote show origin | sed -n '/HEAD branch/s/.*: //p'`
|
||||||
REPO_NAME=`git remote show origin -n | grep -m 1 -oP '(?<=git@github.com:)(.*)(?=.git)'`
|
REPO_NAME=`git remote show origin -n | grep -m 1 -oP '(?<=git@github.com:)(.*)(?=.git)'`
|
||||||
|
|
||||||
if [[ "`git branch --show-current`" != $HEAD_BRANCH ]]; then
|
if [[ "`git branch --show-current`" != $HEAD_BRANCH ]]; then
|
||||||
echo "You must be on the develop branch to run this command."
|
echo "You must be on the $HEAD_BRANCH branch to run this command." >&2
|
||||||
exit 1
|
exit 4
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $(git tag -l "$TAG") ]; then
|
if [ $(git tag -l "$TAG") ]; then
|
||||||
echo "Tag $TAG already exists, not continuing."
|
echo "Tag $TAG already exists, not continuing." >&2
|
||||||
exit 1
|
exit 5
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Drafting a new release"
|
echo "Drafting a new release"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user