-
Notifications
You must be signed in to change notification settings - Fork 7
33 lines (33 loc) · 1.18 KB
/
publish-snapshot.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
name: Publish package to Sonatype OSS Snapshots
on:
workflow_run:
workflows: [CI Build]
types: [completed]
branches: [main]
jobs:
publish-snapshot:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'gradle'
- uses: gradle/wrapper-validation-action@v1
- name: Publish maproulette-java-client
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
# These three GPG vars are required to create the signed *.asc files used to validate each artifact
GPG_KEY_LOCATION: ${{ secrets.GPG_KEY_LOCATION }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
./gradlew build
./gradlew publish \
-PpublishSnapshot=true \
-Psigning.secretKeyRingFile=${GPG_KEY_LOCATION} \
-Psigning.keyId=${GPG_KEY_ID} \
-Psigning.password=${GPG_PASSPHRASE}