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
28 changes: 22 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,31 @@ jobs:
- name: Extract version from release
id: version
run: |
# Extract version from release tag (e.g., refs/tags/1.0.0 -> 1.0.0)
# Extract version from release tag
VERSION="${{ github.ref_name }}"

# If ref_name contains refs/tags/, extract just the tag
if [[ "$VERSION" == refs/tags/* ]]; then
VERSION=${VERSION#refs/tags/}
fi

echo "Extracted VERSION: '$VERSION'"
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT

# Validate semver format
if [[ ! $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9\-\.]+)?(\+[a-zA-Z0-9\-\.]+)?$ ]]; then
echo "Error: Release tag must be in semantic versioning format (e.g., 1.0.0, 2.1.3, 1.0.0-alpha.1)"
exit 1
fi
# Simple validation using case statement for better compatibility
case "$VERSION" in
[0-9]*\.[0-9]*\.[0-9]*)
echo "Version format looks valid"
;;
[0-9]*\.[0-9]*\.[0-9]*-[a-zA-Z0-9.-]*)
echo "Version format with pre-release looks valid"
;;
*)
echo "Error: Release tag must be in semantic versioning format (e.g., 1.0.0, 2.1.3, 1.0.0-alpha.1)"
echo "Got: '$VERSION'"
exit 1
;;
esac

echo "Building version: $VERSION"

Expand Down
Loading