Expose secrets for publish step #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: Test and Publish | |
on: | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
- 'samples/**' | |
- '*.md' | |
push: | |
branches: | |
- 'master' | |
paths-ignore: | |
- 'docs/**' | |
- 'samples/**' | |
- '*.md' | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [macos-latest, macos-14, windows-latest, ubuntu-latest] | |
include: | |
- os: ubuntu-latest | |
EXTRA_GRADLE_ARGS: :test:graalvm:nativeTest apiCheck | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: 17 | |
distribution: 'graalvm-community' | |
set-java-home: false | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: | | |
:mordant:check | |
:test:proguard:r8jar | |
${{matrix.EXTRA_GRADLE_ARGS}} | |
--stacktrace | |
- name: Run R8 Jar | |
run: java -jar test/proguard/build/libs/main-r8.jar | |
- 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: | |
needs: test | |
runs-on: macos-14 | |
if: ${{ github.ref == 'refs/heads/master' && github.repository == 'ajalt/mordant' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Fetch git tags | |
run: git fetch origin +refs/tags/*:refs/tags/* | |
- 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: | |
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 }} | |
env: | |
GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dorg.gradle.parallel=false -Dkotlin.incremental=false -Dorg.gradle.project.kotlin.incremental.multiplatform=false -Dorg.gradle.project.kotlin.native.disableCompilerDaemon=true -Dorg.gradle.jvmargs="-Xmx256m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8" |