-echo "[*] Validating that a semantic version tag is already available on 'origin/${CI_DEFAULT_BRANCH}' to prevent semantic-release from creating the initial release (v1.0.0). You can disable this check by setting the variable
ALLOW_INITIAL_SEMANTIC_RELEASE."
-|
if [ "$(git rev-parse --is-shallow-repository)" != "false" ]; then
echo "[*] Repository is shallow. Unshallowing."
git fetch --unshallow -q
fi
-|
if ! $( (git tag --merged origin/${CI_DEFAULT_BRANCH} ||:) | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]and-some-more$'); then # prevent SIGPIPE (exit 141) if grep exists before piped input is finished, see https://unix.stackexchange.com/a/582850/558271
echo "[!] No semantic version tag is available in the history of 'origin/${CI_DEFAULT_BRANCH}'. Please first create a tag (e.g. 'v0.0.1') on 'origin/${CI_DEFAULT_BRANCH}' and rebase (intermediate branches and) the current branch on that."
exit 1
else
echo "[+] Semantic version tags are available in the history of 'origin/${CI_DEFAULT_BRANCH}'."
fi
rules:
-if:$ALLOW_INITIAL_SEMANTIC_RELEASE != null
when:never
-!reference[.release:rules,rules]
-allow_failure:true
find-next-release:
extends:.release:rules
stage:build
@@ -15,6 +41,9 @@ find-next-release:
-semantic-release --dry-run --no-ci
-echo "TBUMP_NEXT_VERSION=$(cat .VERSION 2>/dev/null || echo "[!] No new