From 2d9a85858af640dcf58b1f2d636ce567db5e3996 Mon Sep 17 00:00:00 2001 From: Timur Sultanaev Date: Sun, 1 Dec 2024 16:19:33 +0100 Subject: [PATCH] release automation script --- tools/release.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tools/release.sh diff --git a/tools/release.sh b/tools/release.sh new file mode 100644 index 0000000..973a4bd --- /dev/null +++ b/tools/release.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -e + +new_version="${1}" + +if [ -z "$new_version" ]; then + echo "Usage: $0 " + exit 1 +fi + +# check that new version is X.Y.Z +if [[ ! $new_version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Version should be in format X.Y.Z where X, Y, Z are numbers" + exit 1 +fi + +packages/update_versions.sh $new_version +git add ./packages +git commit -m "chore: update npm packages versions to $new_version" + +git tag -a "v$new_version" -m "release v$new_version" +goreleaser release --clean + +git push origin "v$new_version" + +