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