-
Notifications
You must be signed in to change notification settings - Fork 121
49 lines (47 loc) · 1.37 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
44
45
46
47
48
49
name: Publish to Nexus
on:
release:
types: [published]
permissions:
actions: write
checks: write
contents: write
deployments: read
issues: write
discussions: write
packages: write
pages: write
pull-requests: write
security-events: write
statuses: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.target_commitish }}
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Publish with Gradle
env:
signingKey: ${{secrets.SIGNING_KEY}}
signingPassword: ${{secrets.SIGNING_PASSWORD}}
OSS_USERNAME: ${{secrets.OSS_USERNAME}}
OSS_PASSWORD: ${{secrets.OSS_PASSWORD}}
run: |
OSS_USERNAME=$OSS_USERNAME OSS_PASSWORD=$OSS_PASSWORD
signingKey=$signingKey signingPassword=$signingPassword
gradle publishToSonatype closeAndReleaseSonatypeStagingRepository --info