-
Notifications
You must be signed in to change notification settings - Fork 9
69 lines (65 loc) · 2.22 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Release
on:
workflow_run:
workflows: ["Maven Build"]
branches: ["master"]
types:
- completed
jobs:
deploy:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
env:
MAVEN_ARGS: -B -ntp -Prelease -Dmaven.test.skip=true
runs-on: ubuntu-latest
steps:
- name: Set up Maven Central Repository
uses: actions/setup-java@v1
with:
java-version: 1.8
server-id: sonatype-nexus-releases
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Configure GPG Key
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
run: |
mkdir -p ~/.gnupg/
printf "$GPG_SIGNING_KEY" | base64 --decode > ~/.gnupg/private.key
gpg --import ~/.gnupg/private.key
- uses: actions/checkout@v2
- name: Bump the version
id: bump_version
uses: mathieudutour/github-tag-action@v5
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
dry_run: true
release_branches: release.*,hotfix.*,master
- name: Build the release
env:
MAVEN_USERNAME: ${{ secrets.NEXUS_USER }}
MAVEN_PASSWORD: ${{ secrets.NEXUS_PWD }}
run: mvn ${MAVEN_ARGS} -Drevision=${{ steps.bump_version.outputs.new_tag }} -Dchangelist= install
- name: Tag the version
id: tag_version
uses: mathieudutour/github-tag-action@v5
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release_branches: release.*,hotfix.*,master
- name: Deploy the release to maven central
env:
MAVEN_USERNAME: ${{ secrets.NEXUS_USER }}
MAVEN_PASSWORD: ${{ secrets.NEXUS_PWD }}
run: mvn ${MAVEN_ARGS} -Drevision=${{ steps.bump_version.outputs.new_tag }} -Dchangelist= deploy
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.bump_version.outputs.new_tag }}
release_name: Release ${{ steps.bump_version.outputs.new_tag }}
body: |
Automatically released due to commit on ${{ github.ref }}
${{ steps.bump_version.outputs.changelog }}
draft: false
prerelease: false