-
Notifications
You must be signed in to change notification settings - Fork 41
45 lines (39 loc) · 1.51 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
name: Release
# based on the action built by samuel meuli: https://github.com/marketplace/actions/action-maven-publish
on: [workflow_dispatch]
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Install Java and Maven
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Setup GPG
env:
GPG_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
shell: bash
run: |
echo "$GPG_KEY" > GPG_KEY.txt
gpg --import --batch GPG_KEY.txt
- name: Configure git
run: |
git config --global committer.email "[email protected]"
git config --global committer.name "GitHub"
git config --global author.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global author.name "${GITHUB_ACTOR}"
- name: Checkout master branch
run: git checkout master
- name: Prepare release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn --batch-mode -Dusername=$GITHUB_ACTOR -Dpassword=$GITHUB_TOKEN release:prepare
- name: Perform release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: mvn --batch-mode --settings settings.xml -Dusername=$GITHUB_ACTOR -Dpassword=$GITHUB_TOKEN release:perform