-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (56 loc) · 1.88 KB
/
Copy pathrelease.yml
File metadata and controls
68 lines (56 loc) · 1.88 KB
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
67
68
name: Release
on:
workflow_dispatch:
inputs:
releaseVersion:
description: 'Release version (e.g. 3.0.1)'
required: true
nextDevVersion:
description: 'Next development version (e.g. 3.0.2-SNAPSHOT)'
required: true
jobs:
perform-release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'corretto'
cache: 'maven'
- name: Configure Git user
run: |
git config user.email "${{ secrets.GH_EMAIL }}"
git config user.name "${{ secrets.GH_USERNAME }}"
- name: Show Maven version
run: mvn --version
- name: Get Artifact Publish Token
id: publish-token
uses: atlassian-labs/artifact-publish-token@v1.0.1
with:
output-modes: environment
- name: Import GPG key
run: echo "${{ secrets.SIGNING_KEY }}" | base64 -d > /tmp/private.key
- name: Prepare release
run: |
export MAVEN_GPG_PASSPHRASE="${{secrets.SIGNING_PASSPHRASE}}" && mvn -B release:prepare \
-DreleaseVersion=${{ github.event.inputs.releaseVersion }} \
-DdevelopmentVersion=${{ github.event.inputs.nextDevVersion }} \
-DscmCommentPrefix="[skip ci] " \
-Dusername=${{ secrets.GH_USERNAME }} \
-Dpassword=${{ secrets.GH_ACCESS_TOKEN }}
- name: Perform release
run: |
mvn -B release:perform \
-DscmCommentPrefix="[skip ci] " \
-Darguments="-Dgpg.signer=bc -Dgpg.useagent=false -Dgpg.keyFilePath=/tmp/private.key"
- name: Clean up GPG key
if: always()
run: rm -f /tmp/private.key