Skip to content

Commit 774098c

Browse files
NewtonDerNewton Dervpaiu
authored
Allow for release candidate version numbers like x.y.z-rc.N (#99)
* Allow for release candidate version numbers like x.y.z-rc.N * Add pre-release tag for release candidates --------- Co-authored-by: Newton Der <[email protected]> Co-authored-by: VictorPaiu <[email protected]>
1 parent 2262020 commit 774098c

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/release.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222

2323
- name: Validate tag
2424
run: |
25-
if ! echo "$VERSION_NUM" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then
26-
echo "Tag $VERSION_NUM does not follow semantic version pattern (x.y.z). Skipping release."
25+
if ! echo "$VERSION_NUM" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$'; then
26+
echo "Tag $VERSION_NUM does not follow semantic version pattern (x.y.z or x.y.z-rc.N). Skipping release."
2727
exit 78 # neutral exit code
2828
fi
2929
echo "Tag $VERSION_NUM follows valid semantic version pattern"
@@ -90,6 +90,13 @@ jobs:
9090
9191
- name: Create GitHub release
9292
run: |
93+
# Check if this is a release candidate
94+
PRERELEASE_FLAG=""
95+
if echo "$VERSION_NUM" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$'; then
96+
PRERELEASE_FLAG="--prerelease"
97+
echo "Detected release candidate version, will mark as prerelease"
98+
fi
99+
93100
# Check if release already exists. Needed when release created via new release in guthub ui
94101
if gh release view "$VERSION_NUM" > /dev/null 2>&1; then
95102
echo "Release for tag $VERSION_NUM already exists, uploading additional assets..."
@@ -98,7 +105,8 @@ jobs:
98105
echo "Creating new release for tag $VERSION_NUM..."
99106
gh release create "$VERSION_NUM" ./*.tar.gz \
100107
--title "Release $VERSION_NUM" \
101-
--notes "Release $VERSION_NUM"
108+
--notes "Release $VERSION_NUM" \
109+
$PRERELEASE_FLAG
102110
fi
103111
handle-failures:
104112
name: Handle Failures

0 commit comments

Comments
 (0)