This repository was archived by the owner on Jul 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (56 loc) · 2.34 KB
/
release.yml
File metadata and controls
67 lines (56 loc) · 2.34 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
name: Release
on:
release:
types: [published]
jobs:
build-project:
name: 'Release'
runs-on: ubuntu-20.04
strategy:
matrix:
java: [ '11' ]
steps:
- uses: actions/checkout@v2
- name: Setup Java JDK
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
check-latest: true
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/tags/})"
id: extract_branch
- name: Output branch name
run: echo ${{ steps.extract_branch.outputs.branch }}
- name: Build Java Project
run: mvn install -P'release' -Dchangelist= -Dgpg.skip=true -Dlicense.skipUpdateLicense=true -DskipTests=true -Dmaven.javadoc.skip=true -B -V --file pom.xml
- name: Unit Tests
run: mvn test
- name: Integration Tests
run: mvn verify
- name: Set up for Sonatype
uses: actions/setup-java@v2
with: # running setup-java again overwrites the settings.xml
distribution: 'adopt'
java-version: '11'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: SONATYPE_USERNAME # env variable for username in deploy
server-password: SONATYPE_PASSWORD # env variable for token in deploy
gpg-private-key: ${{ secrets.GPG_AUTHOR_PRIVATEKEY }} # Value of the GPG private key to import
gpg-passphrase: GPG_AUTHOR_PASSPHRASE # env variable for GPG private key passphrase
- name: Publish to Sonatype (Staging)
run: mvn --batch-mode deploy -P'release,deploy-sonatype' -Dchangelist= -DskipTests=true -Dlicense.skipUpdateLicense=true
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_AUTHOR_PASSPHRASE: ${{ secrets.GPG_AUTHOR_PASSPHRASE }}
- name: Set up for GitHub Packages
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Publish to GitHub Packages
run: mvn --batch-mode deploy -P'release,deploy-github' -Dchangelist= -DskipTests=true -Dlicense.skipUpdateLicense=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}