Skip to content

Commit 0f2d843

Browse files
Update release workflow to support specific version numbers
Co-authored-by: thoughtparametersllc <194255310+thoughtparametersllc@users.noreply.github.com>
1 parent faeb0c2 commit 0f2d843

File tree

3 files changed

+41
-17
lines changed

3 files changed

+41
-17
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -120,23 +120,31 @@ jobs:
120120
121121
echo "Bump type: $BUMP_TYPE"
122122
123-
# Apply version bump
124-
case "$BUMP_TYPE" in
125-
major|MAJOR)
126-
MAJOR=$((MAJOR + 1))
127-
MINOR=0
128-
PATCH=0
129-
;;
130-
minor|MINOR)
131-
MINOR=$((MINOR + 1))
132-
PATCH=0
133-
;;
134-
patch|PATCH|*)
135-
PATCH=$((PATCH + 1))
136-
;;
137-
esac
138-
139-
NEW_VERSION="v${MAJOR}.${MINOR}.${PATCH}"
123+
# Check if BUMP_TYPE is a specific version (e.g., 1.0.0 or v1.0.0)
124+
if [[ "$BUMP_TYPE" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
125+
# Strip 'v' prefix if present
126+
BUMP_TYPE="${BUMP_TYPE#v}"
127+
echo "Using specific version: $BUMP_TYPE"
128+
NEW_VERSION="v${BUMP_TYPE}"
129+
else
130+
# Apply semantic version bump
131+
case "$BUMP_TYPE" in
132+
major|MAJOR)
133+
MAJOR=$((MAJOR + 1))
134+
MINOR=0
135+
PATCH=0
136+
;;
137+
minor|MINOR)
138+
MINOR=$((MINOR + 1))
139+
PATCH=0
140+
;;
141+
patch|PATCH|*)
142+
PATCH=$((PATCH + 1))
143+
;;
144+
esac
145+
146+
NEW_VERSION="v${MAJOR}.${MINOR}.${PATCH}"
147+
fi
140148
141149
echo "Previous version: $LATEST_TAG"
142150
echo "New version: $NEW_VERSION"

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6464
- `badge-style` input to choose between relative paths or GitHub URLs (default: path)
6565
- Automatic README update functionality with marker support
6666
- Badge markers for controlled placement in README files
67+
- Support for specific version numbers in release workflow (e.g., 1.0.0 or v1.0.0)
6768

6869
### Changed
6970
- Badge generation is now opt-in via `generate-badges` input instead of always running
7071
- README updates are now opt-in via `update-readme` input
7172
- Improved badge generation logic with better error handling
73+
- Enhanced release workflow to accept explicit version numbers in addition to major/minor/patch
7274

7375
### Fixed
7476
- Aligned action.yml inputs with documented features in README.md

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,20 @@ This repository includes comprehensive GitHub workflows for CI/CD:
112112

113113
For detailed workflow documentation, see [.github/WORKFLOWS.md](.github/WORKFLOWS.md).
114114

115+
### Releasing
116+
117+
The release workflow supports both automatic semantic versioning and manual version specification:
118+
119+
**Automatic Release** (when changes are merged to main):
120+
- Automatically detects version bump from CHANGELOG.md
121+
- Creates release with extracted changelog notes
122+
- Updates major version tag (e.g., v1)
123+
124+
**Manual Release** (for specific versions):
125+
1. Go to Actions → Release and Marketplace → Run workflow
126+
2. Enter version as `1.0.0` or `v1.0.0` (for specific version) or `major`/`minor`/`patch` (for semantic bump)
127+
3. The workflow will create the release and update tags
128+
115129
### Contributing
116130

117131
1. Fork the repository

0 commit comments

Comments
 (0)