From 11c5a80abac6b69cbeb49d3ecd03fd3866990a3c Mon Sep 17 00:00:00 2001 From: 3y3 <3y3@ya.ru> Date: Fri, 5 Apr 2024 15:07:18 +0300 Subject: [PATCH] Update release process --- script/release.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/script/release.sh b/script/release.sh index 522b066..4b16e91 100755 --- a/script/release.sh +++ b/script/release.sh @@ -2,10 +2,25 @@ set -e +VERSION=$1 + export NODE_ENV=production npm i @diplodoc/cli@latest --no-workspaces -VERSION=$(node -pe 'require("./package.json").dependencies["@diplodoc/cli"]') +CLI_VERSION=$(node -pe 'require("./package.json").dependencies["@diplodoc/cli"]') + +if [[ -n "$(git status -s | grep package.json)" ]]; then + git add package.json package-lock.json + git commit -m "Update cli to version $CLI_VERSION" + git push +fi + +if [[ -n "$(git status -s)" ]]; then + echo "Unable to release unstaged changes" + git status -s + exit 1 +fi -git commit -am "Update cli to version $VERSION" \ No newline at end of file +git tag v$VERSION +git push origin v$VERSION