-
-
Notifications
You must be signed in to change notification settings - Fork 332
40 lines (33 loc) · 1.39 KB
/
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
name: Publishing
on:
# Only publish when 'All tests' has finished on master branch
workflow_run:
workflows: [ All tests ]
branches: [ master ]
types: [ completed ]
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
publish_snapshot:
runs-on: ubuntu-latest
timeout-minutes: 30
if: ${{ github.event.workflow_run.conclusion == 'success' }} # only publish if the tests passed
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 11
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Publish snapshot to Sonatype
env:
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.GRADLE_SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GRADLE_SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_signingSecretKeyRingFile: ${{ secrets.GRADLE_SIGNING_SECRET_KEY_RING_FILE }}
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSS_SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSS_SONATYPE_PASSWORD }}
run: ./gradlew publishToSonatypeStaging --no-parallel
# don't run in parallel - Sonatype doesn't like it