-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
65 lines (60 loc) · 2.01 KB
/
action.yml
File metadata and controls
65 lines (60 loc) · 2.01 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
name: Release to Maven Central
description: "Releases artifacts to Maven Central repository."
inputs:
user:
description: "The user used for the upload (technical user for maven central upload)"
required: true
password:
description: "The password used for the upload (technical user for maven central upload)"
required: true
pgp-pub-key:
description: "The public pgp key ID"
required: true
pgp-private-key:
description: "The private pgp key"
required: true
pgp-passphrase:
description: "The passphrase for pgp"
required: true
java-version:
description: "The Java version the build shall run with."
required: true
maven-version:
description: "The Maven version the build shall run with."
required: true
runs:
using: composite
steps:
- name: Set up Java
uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.8.0
with:
distribution: sapmachine
java-version: ${{ inputs.java-version }}
cache: maven
server-id: central
server-username: MAVEN_CENTRAL_USER
server-password: MAVEN_CENTRAL_PASSWORD
- name: Set up Maven ${{ inputs.maven-version }}
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5
with:
maven-version: ${{ inputs.maven-version }}
- name: Import GPG Key
run: |
echo "${{ inputs.pgp-private-key }}" | gpg --batch --passphrase "$PASSPHRASE" --import
shell: bash
env:
PASSPHRASE: ${{ inputs.pgp-passphrase }}
- name: Deploy to Maven Central
run: >
mvn -B -ntp --show-version
-Dmaven.install.skip=true
-Dmaven.test.skip=true
-Dgpg.passphrase="$GPG_PASSPHRASE"
-Dgpg.keyname="$GPG_PUB_KEY"
clean deploy -P deploy-release
shell: bash
env:
MAVEN_CENTRAL_USER: ${{ inputs.user }}
MAVEN_CENTRAL_PASSWORD: ${{ inputs.password }}
GPG_PASSPHRASE: ${{ inputs.pgp-passphrase }}
GPG_PUB_KEY: ${{ inputs.pgp-pub-key }}