-
Notifications
You must be signed in to change notification settings - Fork 13
53 lines (41 loc) · 1.59 KB
/
gradle-test-build-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_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-latest', 'ubuntu-latest', 'windows-latest' ]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
- name: Set up Java
uses: actions/[email protected]
with:
distribution: 'adopt'
java-version: '17'
check-latest: true
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Publish (macos, jvm, js)
if: matrix.os == 'macos-latest'
run: ./gradlew build publishAllPublicationToOssrhRepository --full-stacktrace
- name: Publish (linux)
if: matrix.os == 'ubuntu-latest'
run: ./gradlew linuxX64Test publishLinuxX64PublicationToOssrhRepository --full-stacktrace
- name: Publish (windows)
if: matrix.os == 'windows-latest'
run: ./gradlew mingwX64Test publishMingwX64PublicationToOssrhRepository --full-stacktrace
- name: Stop Gradle daemons
run: ./gradlew --stop