/gradle-library-release-action

A GitHub action to automate publication to Maven Central

MIT LicenseMIT

gradle-library-release-action

A GitHub action to automate the following:

  • Gradle checks
  • Publication to Sonatype (usually OSSRH, so it gets released to Maven Central)
  • Change log generation (and commit) relying on the GitHub Changelog Gradle Plugin
  • GitHub release creation (with the change log contents)

Requirements

Usage

Here is an example workflow built with this action:

name: release

on:
  workflow_dispatch:
    inputs:
      version:
        description: "New version"
        required: true
jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Set up JDK
        uses: actions/setup-java@v4
        with:
          distribution: 'temurin'
          java-version: 21

      - name: Release
        uses: joffrey-bion/gradle-library-release-action@v2
        with:
          version: ${{ inputs.version }}
          gpg-signing-key: ${{ secrets.GPG_SECRET_ASCII_ARMORED }}
          gpg-signing-password: ${{ secrets.GPG_PASSWORD }}
          sonatype-username: ${{ secrets.OSSRH_USER_TOKEN }}
          sonatype-password: ${{ secrets.OSSRH_KEY }}