Skip to content

feat: add automated semantic versioning with git-semver-plugin#35

Open
adityamparikh wants to merge 4 commits intoapache:mainfrom
adityamparikh:semver
Open

feat: add automated semantic versioning with git-semver-plugin#35
adityamparikh wants to merge 4 commits intoapache:mainfrom
adityamparikh:semver

Conversation

@adityamparikh
Copy link
Contributor

@adityamparikh adityamparikh commented Jan 7, 2026

Summary

  • Add jmongard/git-semver-plugin for automatic version calculation from conventional commits
  • Add auto-release.yml workflow for SNAPSHOT builds and changelog accumulation
  • Add cut-release.yml workflow for manual release creation
  • Update build-and-publish.yml to use plugin-calculated version
  • Comprehensive documentation updates to WORKFLOWS.md

How It Works

Version Calculation

The plugin analyzes commits since the last tag:

  • fix: → patch bump (1.0.0 → 1.0.1)
  • feat: → minor bump (1.0.0 → 1.1.0)
  • feat!: or BREAKING CHANGE: → major bump (1.0.0 → 2.0.0)

Release Flow

PR Merged to main
       │
       ▼
┌──────────────────────┐
│ auto-release.yml     │  SNAPSHOT build
│ Accumulates changelog│  Updates CHANGELOG.md (Unreleased section)
└──────────────────────┘

Manual "Cut Release" (when ready)
       │
       ▼
┌──────────────────────┐
│ cut-release.yml      │  Calculates version from commits
│ Creates v1.0.0 tag   │  Finalizes changelog, creates GitHub Release
└──────────┬───────────┘
           │
           ▼
┌──────────────────────┐
│ build-and-publish    │  Triggered by v* tag
│ Publishes Docker     │  to GHCR
└──────────────────────┘

New Gradle Commands

./gradlew printVersion      # Show calculated version (e.g., 1.0.0-SNAPSHOT)
./gradlew printChangeLog    # Show auto-generated changelog

Test plan

  • ./gradlew printVersion returns 1.0.0-SNAPSHOT
  • ./gradlew printChangeLog generates proper changelog from commits
  • ./gradlew classes compiles successfully
  • Verify auto-release workflow accumulates changelog on merge
  • Verify cut-release workflow creates tag and GitHub Release
  • Verify tag creation triggers Docker publishing

🤖 Generated with Claude Code

@adityamparikh
Copy link
Contributor Author

@epugh @janhoy please review

Copy link
Contributor

@epugh epugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at the WORKFLOWS.md, and I think i see how to do this manually...

adityamparikh and others added 3 commits February 4, 2026 14:39
- Add jmongard/git-semver-plugin for automatic version calculation
- Version derived from git tags and conventional commits
- Add auto-release.yml workflow for automated releases on merge to main
- Update build-and-publish.yml to use plugin version
- Update WORKFLOWS.md with comprehensive documentation

The release flow is now:
1. PR merged → auto-release.yml creates version tag + changelog
2. Tag push → build-and-publish.yml publishes Docker images

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- auto-release.yml now only builds SNAPSHOT and accumulates changelog
- New cut-release.yml for manual release cutting with version tagging
- Changelog accumulates under "Unreleased" until release is cut
- Added version_override option for first release (1.0.0)
- Updated WORKFLOWS.md with complete release flow documentation

Release flow:
1. PR merge → SNAPSHOT build + changelog accumulation (auto)
2. Cut release → version tag + finalized changelog (manual)
3. Official ASF → RC tag + vote + apache/* publish (manual)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update WORKFLOWS.md to clearly document that pull requests:
- Build and test the project
- Upload JAR artifacts (downloadable from GitHub Actions)
- Upload test results and coverage reports
- Do NOT publish Docker images (publish job is skipped)

This clarifies the distinction between PR validation (artifacts only)
and merge/tag triggers (full Docker publishing).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@epugh
Copy link
Contributor

epugh commented Feb 4, 2026

I think this is pending us getting one real release out using the apache trusted release tooling, and then we'll learn enough about how to integrate this.

Signed-off-by: Aditya Parikh <adityamparikh@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants