Skip to content

Publish package to the Maven Central Repository #90

Publish package to the Maven Central Repository

Publish package to the Maven Central Repository #90

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.
name: Publish package to the Maven Central Repository
on:
push:
tags:
- '[0-9]*.[0-9]*.[0-9]*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Restore gradle.properties
env:
GRADLE_PROPERTIES: ${{ secrets.GRADLE_PROPERTIES }}
shell: bash
run: |
echo "${GRADLE_PROPERTIES}" > gradle.properties
- name: Publish package
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository
- name: Close milestone
uses: Beakyn/gha-close-milestone@v1.1.1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
repository: ${{ github.repository }}
milestone-title: ${{ github.ref_name }}
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: 'Get next minor version'
id: semvers
uses: "WyriHaximus/github-action-next-semvers@v1"
with:
version: ${{ steps.previoustag.outputs.tag }}
- name: 'Create new milestone'
id: createmilestone
uses: "WyriHaximus/github-action-create-milestone@v1"
with:
title: ${{ steps.semvers.outputs.patch }}
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"