-
Notifications
You must be signed in to change notification settings - Fork 3
41 lines (37 loc) · 1.32 KB
/
tag.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
name: Publish package to Maven Central Repository
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Matching i.e. v1.0.0, v20.15.10
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+" # Matching i.e. v1.0.0-rc1, v20.15.10-rc0
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
- name: Import signing key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5.2.0
with:
gpg_private_key: ${{ secrets.OSSRH_SIGNING_KEY }}
passphrase: ${{ secrets.OSSRH_PHRASE }}
- name: List keys
run: gpg -K
- name: Publish to maven
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PW: ${{ secrets.OSSRH_PW }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.OSSRH_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.OSSRH_PASSPHRASE }}
RELEASE_VERSION: ${{ github.ref_name }}
run: |
echo $RELEASE_VERSION
./gradlew publish -DVERSION=$RELEASE_VERSION