-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (53 loc) · 1.77 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Maven Publish
on:
workflow_dispatch:
inputs:
libraryVersion:
description: 'Library Version'
required: true
default: ''
packageVersion:
description: 'Package Version'
required: true
default: ''
jobs:
update-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Update Version
run: |
sed -i '/VERSION=/!b;cVERSION=\"v${{ github.event.inputs.libraryVersion }}";' ./download-libs.sh
- name: Commit, Tag and Push
run: |
git add ./download-libs.sh
git config user.name github-actions
git config user.email [email protected]
git commit -m "updated version" | exit 0
git tag ${{ github.event.inputs.packageVersion }}
git push & git push --tags
publish:
needs: update-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git pull origin master --ff-only
- name: Assemble Resources
run: ./download-libs.sh
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
- name: Update Version in pom.xml
run: mvn -B versions:set -DnewVersion=${{ github.event.inputs.packageVersion }} -DgenerateBackupPoms=false
- name: Publish Maven package
uses: samuelmeuli/action-maven-publish@v1
with:
maven_args: "-e -X -Drevision=${{ github.event.inputs.packageVersion }}"
server_id: ossrh
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
nexus_username: ${{ secrets.OSSRH_USERNAME }}
nexus_password: ${{ secrets.OSSRH_PASSWORD }}