generated from it-at-m/oss-repository-en-template
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (64 loc) · 2.37 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: "Default version to use when preparing a release."
required: true
default: "X.Y.Z"
module:
type: choice
description: Service-Name
required: true
options:
- oai-pmh-schema
- oai-pmh-spring-boot-starter
- oai-pmh-spring-boot-starter-parent
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.branch }}
- name: Setup git user
uses: fregante/setup-git-user@v2
- name: Set up JDK 21 and OSSRH auth / GPG signing
uses: actions/setup-java@v3
with:
java-version: "21"
distribution: "temurin"
cache: "maven"
server-id: "central"
server-username: CENTRAL_USERNAME
server-password: CENTRAL_PASSWORD
gpg-private-key: ${{ secrets.gpg_private_key }}
gpg-passphrase: SIGN_KEY_PASS
- name: Perform maven release
run: |
if [ "${{ github.event.inputs.module }}" == "oai-pmh-spring-boot-starter-parent" ]; then
mvn -B -ntp release:prepare release:perform -N \
-DreleaseVersion=${{ github.event.inputs.releaseVersion }} \
-DdevelopmentVersion=${{ github.event.inputs.releaseVersion }}-SNAPSHOT \
-Dtag=${{ github.event.inputs.releaseVersion }} \
-Darguments="-DskipTests"
else
mvn -B -ntp release:prepare release:perform \
-pl ${{ github.event.inputs.module }} -am \
-DreleaseVersion=${{ github.event.inputs.releaseVersion }} \
-DdevelopmentVersion=${{ github.event.inputs.releaseVersion }}-SNAPSHOT \
-Dtag=${{ github.event.inputs.releaseVersion }} \
-Darguments="-DskipTests"
env:
SIGN_KEY_PASS: ${{ secrets.gpg_passphrase }}
CENTRAL_USERNAME: ${{ secrets.sonatype_username }}
CENTRAL_PASSWORD: ${{ secrets.sonatype_password }}
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.releaseVersion }}
draft: false
prerelease: false
generate_release_notes: true