build and publish a release to Central Sonatype #5
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: build and publish a release to Central Sonatype | |
#on: | |
# release: | |
# types: [published] | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: macOS-latest | |
env: | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 21 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v3 | |
- name: Release to Central Sonatype with Gradle | |
run: ./gradlew build publishAggregationPublicationsToSonatypePortalRepository |