Skip to content

Commit faf7c4a

Browse files
committed
release
1 parent 8602dab commit faf7c4a

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

scripts/release.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ Usage: $0 <APP_VERSION> <CHART_VERSION>
2929
Automates the full Reloader release process.
3030
3131
Arguments:
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
3535
Prerequisites:
3636
- gh CLI authenticated with repo access
@@ -52,14 +52,16 @@ CHART_VERSION="$2"
5252
APP_VERSION="${APP_VERSION#v}"
5353
CHART_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
5961
fi
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
6466
fi
6567

0 commit comments

Comments
 (0)