-
-
Notifications
You must be signed in to change notification settings - Fork 5
38 lines (34 loc) · 1.46 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Publish on releases
on:
release:
types:
- created
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
# The publishToSonatype task and the repository release need to be in the same Gradle call
# so that the closeAndRelease task knows which staging repository was created by publishToSonatype
- name: Build and publish to OSS Sonatype and then Maven Central
uses: gradle/gradle-build-action@v3
env:
# GPG keys for signing plugin (sign maven artifacts)
# see https://docs.gradle.org/current/userguide/signing_plugin.html#sec:in-memory-keys
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_SECRET_ASCII_ARMORED }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSWORD }}
# Credentials implicitly read by the gradle-nexus-publish-plugin
# https://github.com/gradle-nexus/publish-plugin#publishing-to-maven-central-via-sonatype-ossrh
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USER_TOKEN }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_KEY }}
with:
arguments: |
publishToSonatype
closeAndReleaseSonatypeStagingRepository
-Pversion=${{ github.event.release.tag_name }}