-
-
Notifications
You must be signed in to change notification settings - Fork 42
44 lines (36 loc) · 1.32 KB
/
maven-publish.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
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
name: Maven Package
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
with:
ref: main
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
distribution: 'zulu'
- name: Configure Git user
run: |
git config user.email "actions@github.com"
git config user.name "GitHub Actions"
- if: github.event.release
name: Update version in pom.xml (Release only)
run: mvn -B versions:set -DnewVersion=${{ github.event.release.tag_name }}-SNAPSHOT
- name: Release Maven package
uses: samuelmeuli/action-maven-publish@v1
with:
gpg_private_key: ${{ secrets.gpg_private_key }}
gpg_passphrase: ${{ secrets.gpg_passphrase }}
nexus_username: ${{ secrets.nexus_username }}
nexus_password: ${{ secrets.nexus_password }}
maven_profiles: publish
maven_goals_phases: release:prepare release:perform
maven_args: -B -X -e