-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (69 loc) · 3.07 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
67
68
69
name: 'Master branch maven release'
on:
push:
branches:
- master
jobs:
quality:
name: 'Static code analysis'
runs-on: 'ubuntu-22.04'
steps:
- name: 'Check out code'
uses: actions/checkout@v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: 'Set up JDK'
uses: actions/setup-java@master
with:
distribution: 'corretto'
java-version: '18' # The JDK version to make available on the path.
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
architecture: x64 # (x64 or x86) - defaults to x64
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: 'SonarCloud Scan'
run: mvn clean verify sonar:sonar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_USERNAME: 2euEqXYt
MAVEN_CENTRAL_TOKEN: ${{ secrets.NEXUS_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ''
release:
name: 'Maven release'
runs-on: 'ubuntu-22.04'
# Skip commit made by maven-release
if: "!contains(github.event.head_commit.message, 'maven-release-plugin')"
steps:
- name: 'Check out code'
uses: actions/checkout@v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: 'Set up JDK'
uses: actions/setup-java@master
with:
distribution: 'corretto'
java-version: '18' # The JDK version to make available on the path.
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
architecture: x64 # (x64 or x86) - defaults to x64
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.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 commit'
run: git config user.email "[email protected]" && git config --global user.name "francis-pang"
- name: 'Prepare release'
run: mvn --batch-mode release:prepare -Dmaven.javadoc.skip=true -DskipTests
env:
MAVEN_GPG_PASSPHRASE: ''
- name: 'Actual release'
run: mvn --batch-mode release:perform -Dmaven.javadoc.skip=true -DskipTests
env:
MAVEN_USERNAME: 2euEqXYt
MAVEN_CENTRAL_TOKEN: ${{ secrets.NEXUS_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ''