-
-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (37 loc) · 1.4 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
41
42
43
name: Publish
on:
workflow_dispatch:
inputs:
ci:
description: "CI pipeline name"
required: false
default: "ci.yml"
jobs:
Publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
- name: Check CI status
run: |
output=$(curl -sSL -X GET -G -H "Accept: application/vnd.github.v3+json" -d "branch=${{ env.GITHUB_REF_SLUG }}" -d "event=push" https://api.github.com/repos/${{ github.repository }}/actions/workflows/${{ github.event.inputs.ci }}/runs | jq -r '.workflow_runs[0] | "\(.conclusion)"')
echo "::set-output name=status::$output"
id: check
- name: Abort if CI not successful
if: steps.check.outputs.status != 'success'
run: |
echo ${{ steps.check.outputs.status }}
exit 1
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 8
- name: Publish to Maven Central
run: |
./gradlew -P signingKey=${{ secrets.SIGNING_KEY }} \
-P signingPassword=${{ secrets.SIGNING_PASSWORD }} \
-P sonatypeUsername=${{ secrets.SONATYPE_USERNAME }} \
-P sonatypePassword=${{ secrets.SONATYPE_PASSWORD }} \
publishToSonatype closeAndReleaseSonatypeStagingRepository