File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,8 +29,8 @@ Usage: $0 <APP_VERSION> <CHART_VERSION>
2929Automates the full Reloader release process.
3030
3131Arguments:
32- APP_VERSION Application version without 'v' prefix (e.g. 1.5.0)
33- CHART_VERSION Helm chart version (e.g. 2.3.0)
32+ APP_VERSION Application version without 'v' prefix (e.g. 1.5.0, 1.5.0-alpha )
33+ CHART_VERSION Helm chart version (e.g. 2.3.0, 2.3.0-rc.1 )
3434
3535Prerequisites:
3636 - gh CLI authenticated with repo access
@@ -52,14 +52,16 @@ CHART_VERSION="$2"
5252APP_VERSION=" ${APP_VERSION# v} "
5353CHART_VERSION=" ${CHART_VERSION# v} "
5454
55- # Validate semver format
56- if ! [[ " $APP_VERSION " =~ ^[0-9]+\. [0-9]+\. [0-9]+$ ]]; then
57- error " APP_VERSION '$APP_VERSION ' is not valid semver (expected X.Y.Z)"
55+ # Validate semver format (with optional prerelease suffix e.g. 1.5.0-alpha, 1.5.0-rc.1)
56+ SEMVER_RE=' ^[0-9]+\.[0-9]+\.[0-9]+([-][a-zA-Z0-9.]+)?$'
57+
58+ if ! [[ " $APP_VERSION " =~ $SEMVER_RE ]]; then
59+ error " APP_VERSION '$APP_VERSION ' is not valid semver (expected X.Y.Z or X.Y.Z-prerelease)"
5860 exit 1
5961fi
6062
61- if ! [[ " $CHART_VERSION " =~ ^[0-9]+ \. [0-9]+ \. [0-9]+$ ]]; then
62- error " CHART_VERSION '$CHART_VERSION ' is not valid semver (expected X.Y.Z)"
63+ if ! [[ " $CHART_VERSION " =~ $SEMVER_RE ]]; then
64+ error " CHART_VERSION '$CHART_VERSION ' is not valid semver (expected X.Y.Z or X.Y.Z-prerelease )"
6365 exit 1
6466fi
6567
You can’t perform that action at this time.
0 commit comments