Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 28 additions & 5 deletions .github/workflows/publish.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand All @@ -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
Expand Down
Loading