Skip to content

Commit d7dea93

Browse files
committed
fix(prepare-releae): Add support for release bump in workflow
Choose 'release' for finalizing a pre-release (8.0.0.dev → 8.0.0), or patch/minor/major to simply bump version.
1 parent 51c6201 commit d7dea93

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/prepare-release.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ on:
44
workflow_dispatch:
55
inputs:
66
bump:
7-
description: 'Version bump type'
7+
description: 'Version bump type. Choose "release" for finalizing a pre-release (8.0.0.dev → 8.0.0), or patch/minor/major to simply bump version.'
88
required: true
99
type: choice
1010
default: 'patch'
1111
options:
12+
- release
1213
- patch
1314
- minor
1415
- major
@@ -36,11 +37,18 @@ jobs:
3637
CURRENT=$(grep VERSION lib/alchemy/solidus/version.rb | sed 's/.*"\(.*\)".*/\1/')
3738
echo "Current version: $CURRENT"
3839
40+
# Strip any pre-release suffix (e.g., .alpha, .beta, .rc1, .a, .b, .c)
41+
BASE_VERSION=$(echo "$CURRENT" | sed 's/\.[a-zA-Z][a-zA-Z0-9]*$//')
42+
echo "Base version: $BASE_VERSION"
43+
3944
# Split into major.minor.patch
40-
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT"
45+
IFS='.' read -r MAJOR MINOR PATCH <<< "$BASE_VERSION"
4146
4247
# Bump based on input
4348
case "${{ inputs.bump }}" in
49+
release)
50+
# Just use the base version (strips pre-release suffix)
51+
;;
4452
major)
4553
MAJOR=$((MAJOR + 1))
4654
MINOR=0

0 commit comments

Comments
 (0)