Skip to content

Commit

Permalink
Default version bump to prerelease (#721) #patch
Browse files Browse the repository at this point in the history
Currently, a merge to main triggers a new `minor` tag. Until we build
some confidence into the codebase, I think we should bump releases as a
`SNAPSHOT` until verified. This will prevent accidental publishing of
unstable releases.
  • Loading branch information
elliotmjackson authored Nov 7, 2022
1 parent 18bd6b7 commit 728ec4b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions .github/actions/github-tag-action/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ source=${SOURCE:-.}
dryrun=${DRY_RUN:-false}
initial_version=${INITIAL_VERSION:-0.0.0}
tag_context=${TAG_CONTEXT:-repo}
prerelease=${PRERELEASE:-false}
suffix=${PRERELEASE_SUFFIX:-beta}
prerelease=${PRERELEASE:-true}
suffix=${PRERELEASE_SUFFIX:-SNAPSHOT}
verbose=${VERBOSE:-false}
major_string_token=${MAJOR_STRING_TOKEN:-#major}
minor_string_token=${MINOR_STRING_TOKEN:-#minor}
Expand Down Expand Up @@ -76,11 +76,11 @@ preTagFmt="^v?[0-9]+\.[0-9]+\.[0-9]+(-$suffix\.[0-9]+)$"

# get latest tag that looks like a semver (with or without v)
case "$tag_context" in
*repo*)
*repo*)
tag="$(git for-each-ref --sort=-v:refname --format '%(refname:lstrip=2)' | grep -E "$tagFmt" | head -n 1)"
pre_tag="$(git for-each-ref --sort=-v:refname --format '%(refname:lstrip=2)' | grep -E "$preTagFmt" | head -n 1)"
;;
*branch*)
*branch*)
tag="$(git tag --list --merged HEAD --sort=-v:refname | grep -E "$tagFmt" | head -n 1)"
pre_tag="$(git tag --list --merged HEAD --sort=-v:refname | grep -E "$preTagFmt" | head -n 1)"
;;
Expand Down Expand Up @@ -130,22 +130,22 @@ case "$log" in
*$major_string_token* ) new=$(semver -i major "$tag"); part="major";;
*$minor_string_token* ) new=$(semver -i minor "$tag"); part="minor";;
*$patch_string_token* ) new=$(semver -i patch "$tag"); part="patch";;
*$none_string_token* )
*$none_string_token* )
echo "Default bump was set to none. Skipping..."
setOutput "new_tag" "$tag"
setOutput "tag" "$tag"
exit 0;;
* )
* )
if [ "$default_semvar_bump" == "none" ]
then
echo "Default bump was set to none. Skipping..."
setOutput "new_tag" "$tag"
setOutput "tag" "$tag"
exit 0
else
exit 0
else
new=$(semver -i "${default_semvar_bump}" "$tag")
part=$default_semvar_bump
fi
part=$default_semvar_bump
fi
;;
esac

Expand All @@ -168,15 +168,15 @@ then
echo -e "Setting ${suffix} pre-tag ${pre_tag} - With pre-tag ${new}"
fi
part="pre-$part"
else
echo -e "Bumping tag ${tag} - New tag ${new}"
fi

if $with_v
then
new="v$new"
fi

echo -e "Bumping tag ${tag} - New tag ${new}"

# as defined in readme if CUSTOM_TAG is used any semver calculations are irrelevant.
if [ -n "$custom_tag" ]
then
Expand Down

0 comments on commit 728ec4b

Please sign in to comment.