Move gradle configuration to convention plugins (#142) #113
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 | |
on: | |
push: | |
paths-ignore: | |
- 'docs/**' | |
- 'samples/**' | |
- '*.md' | |
branches: | |
- master | |
jobs: | |
test: | |
if: github.repository == 'ajalt/mordant' | |
strategy: | |
matrix: | |
os: [macos-latest, windows-latest, ubuntu-latest] | |
include: | |
- os: macos-latest | |
NATIVE_TEST_TASK: :mordant:linkDebugTestMacosArm64 :mordant:macosX64Test | |
- os: windows-latest | |
NATIVE_TEST_TASK: :mordant:mingwX64Test | |
- os: ubuntu-latest | |
NATIVE_TEST_TASK: :mordant:linuxX64Test apiCheck | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache Kotlin Native Compiler | |
uses: actions/cache@v3 | |
with: | |
path: ~/.konan | |
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*') }} | |
restore-keys: ${{ runner.os }}-konan- | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: :mordant:jvmTest :mordant:jsTest ${{matrix.NATIVE_TEST_TASK}} --stacktrace | |
- name: Bundle the build report | |
if: failure() | |
run: find . -type d -name 'reports' | zip -@ -r build-reports.zip | |
- name: Upload the build report | |
if: failure() | |
uses: actions/upload-artifact@master | |
with: | |
name: error-report | |
path: build-reports.zip | |
publish-all-targets: | |
needs: test | |
runs-on: macos-latest | |
if: github.repository == 'ajalt/mordant' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Fetch git tags | |
run: git fetch origin +refs/tags/*:refs/tags/* | |
- name: Cache Kotlin Native Compiler | |
uses: actions/cache@v3 | |
with: | |
path: ~/.konan | |
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*') }} | |
restore-keys: ${{ runner.os }}-konan- | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Deploy to sonatype | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: :mordant:publish -PinferVersion=true | |
env: | |
# configureondemand=false to work around KT-51763 | |
GRADLE_OPTS: -Dorg.gradle.configureondemand=false -Dorg.gradle.parallel=true -Dkotlin.incremental=false -Dorg.gradle.project.kotlin.incremental.multiplatform=false -Dorg.gradle.project.kotlin.native.disableCompilerDaemon=true -Dorg.gradle.jvmargs="-Xmx5g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8" | |
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralPassword }} | |
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKey }} | |
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralUsername }} |