From 6cad903b17fc58553c9dcd92fdea57627cf5fa74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Garc=C3=ADa=20Crespo?= Date: Tue, 13 Aug 2024 06:33:54 +0000 Subject: [PATCH] Add release just recipe --- justfile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/justfile b/justfile index d2f66930..e3350ed5 100644 --- a/justfile +++ b/justfile @@ -21,3 +21,26 @@ run: transfer: ./hack/ccp/hack/transfer-via-api.sh + +# Tag and release new version. +release: + #!/usr/bin/env bash + set -euo pipefail + branch=qa/2.x + git checkout ${branch} > /dev/null 2>&1 + git diff-index --quiet HEAD || (echo "Git directory is dirty" && exit 1) + version=v$(semver bump prerelease beta.. $(git describe --abbrev=0)) + echo "Detected version: ${version}" + read -n 1 -p "Is that correct (y/N)? " answer + echo + case ${answer:0:1} in + y|Y ) + echo "Tagging release with version ${version}" + ;; + * ) + echo "Aborting" + exit 1 + ;; + esac + git tag -m "Release ${version}" $version + git push origin refs/tags/$version