-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (40 loc) · 1.45 KB
/
release.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
50
name: Release
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Set release version
run: |
echo "RELEASE_VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- name: Set patch version
run: |
echo "BUILD_NUMBER=`echo $RELEASE_VERSION | sed -r 's/v?([0-9]+\.){2}([0-9]+).*/\2/'`" >> $GITHUB_ENV
- uses: actions/checkout@v3
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: build
run: ./gradlew build
- name: Retrieve the secret and decode it to a file
env:
SIGNING_SECRET_KEY_RING_BASE64: ${{ secrets.SIGNING_SECRET_KEY_RING_BASE64 }}
run: |
echo $SIGNING_SECRET_KEY_RING_BASE64 | base64 --decode > ${{ github.workspace }}/signing-secret-key-ring.gpg
- name: Publish to Maven Central
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_SECRET_KEY_RING_FILE: ${{ github.workspace }}/signing-secret-key-ring.gpg
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}