diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4c532a7..1cafb30 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -120,23 +120,31 @@ jobs: echo "Bump type: $BUMP_TYPE" - # Apply version bump - case "$BUMP_TYPE" in - major|MAJOR) - MAJOR=$((MAJOR + 1)) - MINOR=0 - PATCH=0 - ;; - minor|MINOR) - MINOR=$((MINOR + 1)) - PATCH=0 - ;; - patch|PATCH|*) - PATCH=$((PATCH + 1)) - ;; - esac - - NEW_VERSION="v${MAJOR}.${MINOR}.${PATCH}" + # Check if BUMP_TYPE is a specific version (e.g., 1.0.0 or v1.0.0) + if [[ "$BUMP_TYPE" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + # Strip 'v' prefix if present + BUMP_TYPE="${BUMP_TYPE#v}" + echo "Using specific version: $BUMP_TYPE" + NEW_VERSION="v${BUMP_TYPE}" + else + # Apply semantic version bump + case "$BUMP_TYPE" in + major|MAJOR) + MAJOR=$((MAJOR + 1)) + MINOR=0 + PATCH=0 + ;; + minor|MINOR) + MINOR=$((MINOR + 1)) + PATCH=0 + ;; + patch|PATCH|*) + PATCH=$((PATCH + 1)) + ;; + esac + + NEW_VERSION="v${MAJOR}.${MINOR}.${PATCH}" + fi echo "Previous version: $LATEST_TAG" echo "New version: $NEW_VERSION" diff --git a/CHANGELOG.md b/CHANGELOG.md index 179577d..09b7ba4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Changelog validation in release process - Security audit workflow with Dependabot - Lint and test workflow for PRs and pushes +- Support for specific version numbers in release workflow (e.g., 1.0.0 or v1.0.0) + +### Changed +- Enhanced release workflow to accept explicit version numbers in addition to major/minor/patch ## [1.0.0] - Previous Release diff --git a/README.md b/README.md index 1fd894a..979d317 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,20 @@ This repository includes comprehensive GitHub workflows for CI/CD: For detailed workflow documentation, see [.github/WORKFLOWS.md](.github/WORKFLOWS.md). +### Releasing + +The release workflow supports both automatic semantic versioning and manual version specification: + +**Automatic Release** (when changes are merged to main): +- Automatically detects version bump from CHANGELOG.md +- Creates release with extracted changelog notes +- Updates major version tag (e.g., v1) + +**Manual Release** (for specific versions): +1. Go to Actions → Release and Marketplace → Run workflow +2. Enter version as `1.0.0` or `v1.0.0` (for specific version) or `major`/`minor`/`patch` (for semantic bump) +3. The workflow will create the release and update tags + ### Contributing 1. Fork the repository