-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (28 loc) · 1 KB
/
maven-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
name: Publish the Java Package to Maven Central Repository
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
jobs:
publish:
runs-on: ubuntu-latest
defaults:
run:
working-directory: java
steps:
- uses: actions/checkout@v2
- name: Set version
id: version
run: |
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/v##g")
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Upload the package to Maven Central Repository
run: |
echo "${{ secrets.SIGNING_SECRET_KEY_RING }}" | base64 -d > ~/.gradle/secring.gpg
./gradlew publish \
-Pversion="${{ steps.version.outputs.version }}" \
-Psigning.keyId="${{ secrets.SIGNING_KEY_ID }}" \
-Psigning.password="${{ secrets.SIGNING_PASSWORD }}" \
-Psigning.secretKeyRingFile="$(echo ~/.gradle/secring.gpg)" \
-PossrhUsername="${{ secrets.OSSRH_USERNAMAE }}" \
-PossrhPassword="${{ secrets.OSSRH_PASSWORD }}"