Skip to content

gradle library

gradle library #1

name: gradle-based jvm libraries
jobs:
build:
if: "!contains(github.event.commits[0].message, 'release-')"
runs-on: ubuntu-22.04
permissions:
contents: write
environment: ci
steps:
- uses: actions/checkout@v4
- name: set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: setup gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
- name: increment project version
run: |
./gradlew release-paperwork
git push
- name: build gradle distributions
run: ./gradlew buildGradleDist
- name: build documentation jar
run: ./gradlew docJar
- name: publish to maven central
env:
MAVEN_CENTRAL_USER: ${{ secrets.MAVEN_CENTRAL_USER }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
run: |
echo "$SIGNING_KEY" | gpg --dearmor > ./key.gpg
echo "sonatypeUsername=$MAVEN_CENTRAL_USER" >> ./gradle.properties
echo "sonatypePassword=$MAVEN_CENTRAL_PASSWORD" >> ./gradle.properties
echo "signing.keyId=$SIGNING_KEY_ID" >> ./gradle.properties
echo "signing.secretKeyRingFile=./key.gpg" >> ./gradle.properties
echo "signing.password=$SIGNING_PASSWORD" >> ./gradle.properties
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository