-
Notifications
You must be signed in to change notification settings - Fork 13
58 lines (48 loc) · 1.8 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
53
54
55
56
57
58
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-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: Publish JVM, JS and MacOS versions
uses: gradle/[email protected]
if: matrix.os == 'macos-11'
with:
cache-disabled: true
arguments: --full-stacktrace build publishAllPublicationToOssrhRepository
- name: Publish Linux version
uses: gradle/[email protected]
if: matrix.os == 'ubuntu-latest'
with:
cache-disabled: true
arguments: --full-stacktrace linuxX64Test publishLinuxX64PublicationToOssrhRepository
- name: Publish Windows version
uses: gradle/[email protected]
if: matrix.os == 'windows-latest'
with:
cache-disabled: true
arguments: --full-stacktrace mingwX64Test publishMingwX64PublicationToOssrhRepository
- name: Stop Gradle daemons
run: ./gradlew --stop