diff --git a/src/release.sh b/src/release.sh index 15aa23920901531ee65abf63f0d4e3547af1a2ff..d20507b1d0aebdf7290e07bcf940e32ac9cc639b 100755 --- a/src/release.sh +++ b/src/release.sh @@ -10,4 +10,35 @@ cd "$CI_PROJECT_NAME" standard-version echo "Pushing new commit" + +# Check arguments for --run-tag-pipeline +while :; do + case $1 in + -t|--run-tag-pipeline) + # Push the commit separately from the tag + git push -o ci.skip + # Grab the tag at this commit + TAG=$(git tag --points-at HEAD) + # Push the tag to origin + git push origin "$TAG" + exit + ;; + --) + # End of options + shift + break + ;; + -?*) + # Unrecognised option - ignore and continue + printf 'WARN: Unknown option (ignored): %s\n' "$1" >&2 + ;; + *) + # Default case, flag not found, break out and continue with the default command + break + esac + + shift +done + +# No flag passed, follow-tags instead git push --follow-tags -o ci.skip \ No newline at end of file