-
Notifications
You must be signed in to change notification settings - Fork 26
45 lines (39 loc) · 1.23 KB
/
version-and-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
name: Release
on:
release:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Set up Java with Maven cache
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
cache: 'maven'
server-id: oss
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Update version in Maven configuration
run: |
mvn --no-transfer-progress \
--batch-mode \
versions:set -DnewVersion=${{ github.event.release.tag_name }}
if: ${{ github.event.release.tag_name }}
- name: Install GPG key
run: |
cat <(echo -e "${{ secrets.GPG_SECRET }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Publish to Maven
run: |
mvn --no-transfer-progress \
--batch-mode \
-Dgpg.passphrase='${{ secrets.GPG_PASSWORD }}' \
-DskipTests deploy -P sonatype-oss-release
env:
MAVEN_USERNAME: ${{secrets.OSSRH_USER}}
MAVEN_PASSWORD: ${{secrets.OSSRH_PASSWORD}}