-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (45 loc) · 1.98 KB
/
maven-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
51
name: Release
on:
workflow_dispatch:
inputs:
releaseVersion:
description: 'Release Version'
required: true
type: string
developementVersion:
description: 'Developement Version'
required: true
type: string
default: '-SNAPSHOT'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
server-id: ossrh-releases-pendula95 # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_CENTRAL_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: Configure git user
run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
- name: Release
id: releas
run: mvn -B release:prepare release:perform -Dresume=false -DskipTests=true -Dtag=$RELEASE_VERSION -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPEMENT_VERSION -DcompletionGoals=install -DfailOnDeprecation=false -Darguments="-Dmaven.site.skip=true -Dmaven.site.deploy.skip=true"
env:
GITHUB_TOKEN: ${{ github.token }} # GITHUB_TOKEN is the default env for the password
RELEASE_VERSION: ${{ inputs.releaseVersion }}
DEVELOPEMENT_VERSION: ${{ inputs.developementVersion }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_TOKEN }}
MAVEN_CENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Rollback
if: failure()
run: mvn release:rollback -B