You've already forked athens-proxy-charts
fix(scripts): support pre-releases
This commit is contained in:
@@ -8,8 +8,9 @@ if [ ! -f "${CHART_FILE}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DEFAULT_NEW_TAG="$(git tag --sort=-version:refname | head -n 1)"
|
||||
DEFAULT_OLD_TAG="$(git tag --sort=-version:refname | head -n 2 | tail -n 1)"
|
||||
# Exclude prerelease tags (matching -rc or -rc-<digits>) from default tag selection
|
||||
DEFAULT_NEW_TAG="$(git tag --sort=-version:refname | grep --invert-match --perl-regexp '\-rc(-[0-9]+)?$' | head --lines 1)"
|
||||
DEFAULT_OLD_TAG="$(git tag --sort=-version:refname | grep --invert-match --perl-regexp '\-rc(-[0-9]+)?$' | head --lines 2 | tail --lines 1)"
|
||||
|
||||
if [ -z "${1}" ]; then
|
||||
read -p "Enter start tag [${DEFAULT_OLD_TAG}]: " OLD_TAG
|
||||
@@ -54,6 +55,13 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check if NEW_TAG is a prerelease (matches -rc or -rc-<digits> suffix)
|
||||
if [[ "${NEW_TAG}" =~ -rc(-[0-9]+)?$ ]]; then
|
||||
echo "INFO: Tag '${NEW_TAG}' is a prerelease, setting prerelease annotation and skipping changelog."
|
||||
yq --no-colors --inplace ".annotations.\"artifacthub.io/prerelease\" = \"true\" | sort_keys(.)" "${CHART_FILE}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
CHANGE_LOG_YAML=$(mktemp)
|
||||
echo "[]" > "${CHANGE_LOG_YAML}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user