-
Notifications
You must be signed in to change notification settings - Fork 6
40 lines (34 loc) · 1.46 KB
/
publish-maven-central.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
# This is a manually triggered workflow (hence on: workflow_dispatch).
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#manual-events
name: Publish to Maven Central
on:
workflow_dispatch:
inputs:
version:
description: 'Version, without v prefix, appended to v to locate tag'
required: true
jobs:
publish:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v3
with:
ref: v${{ github.event.inputs.version }}
# Gradle 7 requires Java 11 to run
- uses: actions/setup-java@v3
with:
distribution: zulu
java-version: '19'
- name: Publish to Repositories
env:
ORG_GRADLE_PROJECT_MAPBOX_DOWNLOADS_TOKEN: ${{ secrets.MAPBOX_DOWNLOADS_TOKEN }}
ORG_GRADLE_PROJECT_OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_SIGNING_KEY_ID: ${{ secrets.MAVEN_SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_SIGNING_PASSWORD: ${{ secrets.MAVEN_SIGNING_KEY_PASSWORD }}
ORG_GRADLE_PROJECT_SIGNING_KEY_BASE64: ${{ secrets.MAVEN_SIGNING_KEY_RING_FILE_BASE64 }}
run: |
echo "Publishing version ${{ github.event.inputs.version }} to MavenCentral..."
./gradlew --stacktrace -PpublishTarget=MavenCentral -PruntimeSecrets=USE_DUMMY_EMPTY_STRING_VALUES publishToSonatype closeAndReleaseSonatypeStagingRepository