Release to Maven Central #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release to Maven Central | |
on: [workflow_dispatch] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- name: Set version to release version | |
uses: eskatos/gradle-command-action@v1 | |
with: | |
arguments: prepareReleaseVersion | |
- name: Get version to release | |
id: version | |
uses: eskatos/gradle-command-action@v1 | |
with: | |
arguments: saveVersionForGitHub | |
- name: Commit changes | |
uses: EndBug/add-and-commit@v4 | |
with: | |
add: build.gradle.kts | |
tag: v${{steps.version.outputs.version}} | |
message: Prepare release for ${{steps.version.outputs.version}} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build with Gradle | |
uses: eskatos/gradle-command-action@v1 | |
env: | |
CI: true | |
OSS_SONATYPE_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }} | |
OSS_SONATYPE_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }} | |
GPG_SIGNING_KEY_ASCII_ARMORED_FORMAT: ${{ secrets.GPG_SIGNING_KEY_ASCII_ARMORED_FORMAT }} | |
GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }} | |
with: | |
arguments: assemble publishMavenJavaPublicationToMavenRepository closeAndReleaseRepository | |
- name: Set version to next SNAPSHOT version | |
uses: eskatos/gradle-command-action@v1 | |
with: | |
arguments: prepareNextSnapshotVersion | |
- name: Get version to release | |
id: nextversion | |
uses: eskatos/gradle-command-action@v1 | |
with: | |
arguments: saveVersionForGitHub | |
- name: Commit changes | |
uses: EndBug/add-and-commit@v4 | |
with: | |
add: build.gradle.kts | |
message: Prepare for next development iteration with version ${{steps.nextversion.outputs.version}} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |