Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:

- name: Validate tag
run: |
if ! echo "$VERSION_NUM" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "Tag $VERSION_NUM does not follow semantic version pattern (x.y.z). Skipping release."
if ! echo "$VERSION_NUM" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$'; then
echo "Tag $VERSION_NUM does not follow semantic version pattern (x.y.z or x.y.z-rc.N). Skipping release."
exit 78 # neutral exit code
fi
echo "Tag $VERSION_NUM follows valid semantic version pattern"
Expand Down Expand Up @@ -90,6 +90,13 @@ jobs:

- name: Create GitHub release
run: |
# Check if this is a release candidate
PRERELEASE_FLAG=""
if echo "$VERSION_NUM" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$'; then
PRERELEASE_FLAG="--prerelease"
echo "Detected release candidate version, will mark as prerelease"
fi

# Check if release already exists. Needed when release created via new release in guthub ui
if gh release view "$VERSION_NUM" > /dev/null 2>&1; then
echo "Release for tag $VERSION_NUM already exists, uploading additional assets..."
Expand All @@ -98,7 +105,8 @@ jobs:
echo "Creating new release for tag $VERSION_NUM..."
gh release create "$VERSION_NUM" ./*.tar.gz \
--title "Release $VERSION_NUM" \
--notes "Release $VERSION_NUM"
--notes "Release $VERSION_NUM" \
$PRERELEASE_FLAG
fi
handle-failures:
name: Handle Failures
Expand Down