From 77e4c6912ed418f92471c440d948e0c6804be26b Mon Sep 17 00:00:00 2001 From: Thomas Deblock Date: Sun, 4 Jan 2026 16:36:19 +0100 Subject: [PATCH] feat: add release workflow with automatic semantic versioning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace publish.yml with a new release.yml workflow that: - Analyzes commits since last tag using conventional commits - Automatically determines version bump (patch/minor/major) - Allows forcing a major version bump via checkbox - Creates git tag, publishes to Maven Central, creates GitHub release Commit conventions: - fix:, docs:, refactor:, etc. → patch - feat: → minor - feat!: or BREAKING CHANGE: → major 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../workflows/{publish.yml => release.yml} | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) rename .github/workflows/{publish.yml => release.yml} (60%) diff --git a/.github/workflows/publish.yml b/.github/workflows/release.yml similarity index 60% rename from .github/workflows/publish.yml rename to .github/workflows/release.yml index 798ebb5..8900864 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/release.yml @@ -1,17 +1,24 @@ -name: Publish to Maven Central +name: Release on: - release: - types: [ created ] + workflow_dispatch: + inputs: + force-major: + description: 'Force major version bump' + required: false + type: boolean + default: false jobs: - publish: + release: runs-on: ubuntu-latest permissions: - contents: read + contents: write steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set up JDK 21 uses: actions/setup-java@v4 @@ -22,6 +29,14 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 + - name: Calculate and create tag + id: version + uses: mathieudutour/github-tag-action@v6.2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + default_bump: ${{ inputs.force-major && 'major' || 'patch' }} + release_branches: master + - name: Build with Gradle run: ./gradlew build @@ -39,6 +54,14 @@ jobs: JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_PRIVATE_KEY }} JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create GitHub Release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release create "${{ steps.version.outputs.new_tag }}" \ + --title "${{ steps.version.outputs.new_tag }}" \ + --generate-notes + - name: Upload JReleaser logs if: always() uses: actions/upload-artifact@v4