-
Notifications
You must be signed in to change notification settings - Fork 58
66 lines (58 loc) · 2.3 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Release
on:
workflow_dispatch:
inputs:
releaseVersion:
description: 'Release version'
required: true
default: '2.9'
releaseBuild:
description: 'Release build'
required: true
default: ''
jobs:
release:
name: Release on Sonatype OSS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '8'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Configure Git User
run: |
git config user.email ${{ secrets.GIT_CONFIG_EMAIL }}
git config user.name "RWS Artifact Publishers"
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: 'dummy'
- name: Release
env:
RELEASE: ${{ github.event.inputs.releaseVersion }}.${{ github.event.inputs.releaseBuild }}
SNAPSHOT: ${{ github.event.inputs.releaseVersion }}-SNAPSHOT
TAG: release/${{ github.event.inputs.releaseVersion }}/${{ github.event.inputs.releaseVersion }}.${{ github.event.inputs.releaseBuild }}
# Suppress logging during release prep/perform
LOGGING: org.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
run: |
echo "::group::Prepare"
mvn --batch-mode --no-transfer-progress release:prepare -DreleaseVersion=${{ env.RELEASE }} \
-DdevelopmentVersion=${{ env.SNAPSHOT }} -Dtag=${{ env.TAG }} \
-D${{ env.LOGGING }}
echo "::endgroup::"
echo "::group::Perform"
mvn --batch-mode --no-transfer-progress release:perform -DreleaseVersion=${{ env.RELEASE }} \
-DdevelopmentVersion=${{ env.SNAPSHOT }} -Dtag=${{ env.TAG }} \
-D${{ env.LOGGING }}
echo "::endgroup::"