Merge pull request #257 from fraktalio/renovate/gradle-gradle-build-a… #233
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: CI with Gradle - Test, Build and Publish | |
# Trigger the workflow on push, | |
# but only for the main branch | |
on: | |
push: | |
branches: [ main ] | |
env: | |
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.parallel=false -Dorg.gradle.jvmargs="-Xmx5g -XX:+UseParallelGC -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8" | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
GPG_PRIVATE_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
GPG_PRIVATE_PASSWORD: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
jobs: | |
publish: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ 'macos-11', 'ubuntu-latest', 'windows-latest' ] | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Java | |
uses: actions/setup-java@v4.0.0 | |
with: | |
distribution: 'adopt' | |
java-version: '17' | |
check-latest: true | |
- name: Publish JVM, JS and MacOS versions | |
uses: gradle/gradle-build-action@v2.11.1 | |
if: matrix.os == 'macos-11' | |
with: | |
cache-disabled: true | |
arguments: --full-stacktrace build publishAllPublicationToOssrhRepository | |
- name: Publish Linux version | |
uses: gradle/gradle-build-action@v2.11.1 | |
if: matrix.os == 'ubuntu-latest' | |
with: | |
cache-disabled: true | |
arguments: --full-stacktrace linuxX64Test publishLinuxX64PublicationToOssrhRepository | |
- name: Publish Windows version | |
uses: gradle/gradle-build-action@v2.11.1 | |
if: matrix.os == 'windows-latest' | |
with: | |
cache-disabled: true | |
arguments: --full-stacktrace mingwX64Test publishMingwX64PublicationToOssrhRepository | |
- name: Stop Gradle daemons | |
run: ./gradlew --stop |