Skip to content

Migrate to Sonatype Central Portal (#38) #16

Migrate to Sonatype Central Portal (#38)

Migrate to Sonatype Central Portal (#38) #16

Workflow file for this run

name: Publish a release
on:
push:
branches:
- main
tags:
- '*'
concurrency:
group: "release"
cancel-in-progress: false
jobs:
publish_archives:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout the repo
uses: actions/checkout@v3
with:
lfs: true
# https://github.com/gradle/gradle-build-action/issues/561
- name: Create Gradle files
run: |
cd ~
mkdir -p .gradle/ && touch .gradle/gradle.properties
- name: Set up Java
id: setup-java
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: 17
- name: Setup Gradle Java installations paths
run: |
cd ~/.gradle
echo "org.gradle.java.installations.paths=${{ steps.setup-java.outputs.path }}" >> gradle.properties
- name: Setup gradle
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
- name: Assemble in parallel
run: ./gradlew -PRELEASE_SIGNING_ENABLED=false publishToMavenLocal build
- name: Publish the artifacts
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SECRET_PASSPHRASE }}
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-parallel --stacktrace
env:
GRADLE_OPTS: -Dorg.gradle.parallel=true -Dorg.gradle.caching=true