Merge pull request #19 from square/develop #8
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: 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 publishToMavenLocal build | |
- name: Publish the artifacts | |
env: | |
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} | |
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} | |
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ARTIFACT_SIGNING_PRIVATE_KEY }} | |
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-parallel --stacktrace | |
env: | |
GRADLE_OPTS: -Dorg.gradle.parallel=true -Dorg.gradle.caching=true |