Updated the build-release.yml workflow to automatically increment the patch version on every commit and create GitHub releases immediately.
- Changed
bump_each_commit: false→bump_each_commit: true - Changed
search_commit_body: false→search_commit_body: true - Result: Every commit to main now increments the patch version (e.g., v1.0.0 → v1.0.1)
- Removed the separate
releasejob that waited for tag pushes - Added release creation directly to the
buildjob - Result: One workflow run = build + release (faster, simpler)
- Added
Create GitHub Releasestep that runs on every main branch push - Uses
softprops/action-gh-release@v2to create releases with tags - Automatically generates release notes from commits
- Result: Every commit to main creates a new release
- Removed
tags: - 'v*.*.*'from workflow triggers - Removed job condition checking for tag refs
- Result: Cleaner workflow that doesn't depend on pre-existing tags
-
Patch (default): Regular commits increment patch version
git commit -m "Fix button alignment issue" → v1.0.0 → v1.0.1 -
Minor: Use
(MINOR)in commit message for new featuresgit commit -m "(MINOR) Add export to CSV feature" → v1.0.1 → v1.1.0 -
Major: Use
(MAJOR)in commit message for breaking changesgit commit -m "(MAJOR) Rewrite registry service API" → v1.1.0 → v2.0.0
- Developer pushes commit to main branch
- GitHub Actions calculates semantic version based on git history
- Builds and publishes the application with that version
- Creates a ZIP package
- Uploads artifact for download
- Creates a GitHub Release with:
- The calculated version tag (e.g., v1.0.2)
- The ZIP file attached
- Auto-generated release notes from commits
- Custom release body with installation instructions
- PR builds still run to validate code
- No releases are created for PRs (only builds and artifacts)
- Release creation only happens on pushes to main
To verify this works:
-
Make a test commit (any small change):
git add . git commit -m "Test automatic release workflow" git push origin main
-
Watch GitHub Actions:
- Go to: https://github.com/ilude/ContextMenuEditor/actions
- The workflow should complete successfully
- A new release should appear at: https://github.com/ilude/ContextMenuEditor/releases
-
Check the release:
- Should have a new version tag (e.g., v1.1.1 if current is v1.1.0)
- Should include the ZIP file
- Should have release notes generated from commits
✅ Every commit to main → New patch version + new release
✅ Commits with (MINOR) → New minor version + new release
✅ Commits with (MAJOR) → New major version + new release
✅ Pull requests → Build only (no release)
✅ Manual trigger → Build + release with current version
The old workflow required:
- Build job runs → creates tag
- Tag push triggers → separate release job
- Release job builds again → creates release
Problem: The tag push from step 1 didn't trigger step 2 in the same workflow run.
New approach: Build and release in one job, creating the tag and release together.
- Simpler: One job instead of two
- Faster: No duplicate builds
- Automatic: No manual tag creation needed
- Reliable: Release creation happens immediately after build
- Traceable: Every commit = one version = one release