-
Notifications
You must be signed in to change notification settings - Fork 3
74 lines (67 loc) · 1.93 KB
/
release-and-deploy-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
70
71
72
73
74
name: release and deploy
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
steps:
# Checkout source code
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: '0'
# Setup Java environment
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Maven setup
uses: ./.github/actions/mvn-setup
with:
mgnl_nexus_user: ${{secrets.MGNL_NEXUS_USER}}
mgnl_nexus_pass: ${{secrets.MGNL_NEXUS_PASS}}
# Install xmllint
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install libxml2-utils
# Set git user name and email
- name: Set up Git
run: |
chmod +x ci/setup-git.sh
ci/setup-git.sh
# Release, set correct versions and create tag
- name: Release (versioning/tag)
run: |
chmod +x ci/mvn-release.sh
ci/mvn-release.sh
deploy-release:
needs: release
runs-on: ubuntu-latest
steps:
# Checkout source code
- name: Checkout
uses: actions/checkout@v2
with:
ref: 'main'
# Setup Java environment
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Maven setup
uses: ./.github/actions/mvn-setup
with:
mgnl_nexus_user: ${{secrets.MGNL_NEXUS_USER}}
mgnl_nexus_pass: ${{secrets.MGNL_NEXUS_PASS}}
# Run maven verify
- name: Maven verify
run: mvn verify --batch-mode
# Publish
- 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.OSSRH_USER }}
nexus_password: ${{ secrets.OSSRH_PASSWORD }}