-
Notifications
You must be signed in to change notification settings - Fork 73
43 lines (37 loc) · 1.43 KB
/
release-to-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
41
42
43
name: Release to Maven Central
on:
workflow_dispatch:
inputs:
releaseversion:
description: 'Release version'
required: true
default: 'X.X.X'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Apache Maven Central
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'
server-id: central
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.GPG_SIGN_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: Set projects Maven version to GitHub Action GUI set version
run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}"
- name: Build with Maven
run: |
mvn -B clean --file pom.xml
mvn -B package --file pom.xml -DskipTests=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to Apache Maven Central
run: mvn -B deploy -Psign --file pom.xml
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME}}
MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_SIGN_PASSPHRASE }}