-
Notifications
You must be signed in to change notification settings - Fork 2
38 lines (35 loc) · 1.17 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
name: publish
on: { push: { branches: [main] } }
jobs:
detect-publish:
runs-on: ubuntu-latest
outputs:
publish: ${{ steps.detect-publish.outputs.publish }}
steps:
- uses: actions/checkout@v3
- id: detect-publish
run: |
result=$(./scripts/detect-publish.sh)
echo $result
echo ::set-output name=publish::$result
publish:
runs-on: ubuntu-latest
needs: [detect-publish]
if: needs.detect-publish.outputs.publish == 1
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with: { java-version: 17, distribution: temurin }
- name: Publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY: ${{ github.repository }}
run: |
./gradlew \
-P signingKey=${{ secrets.ORG_GRADLE_PROJECT_signingKey }} \
-P signingPassword=${{ secrets.ORG_GRADLE_PROJECT_signingPassword }} \
-P ossrhUsername=${{ secrets.OSSRH_USERNAME }} \
-P ossrhPassword=${{ secrets.OSSRH_PASSWORD }} \
publishToSonatype \
closeAndReleaseSonatypeStagingRepository
./scripts/publish.sh