-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (51 loc) · 1.67 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
name: Release
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to release from'
required: true
default: ''
type:
description: 'Release type (hotfix / minor / major)'
required: true
default: 'minor'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: kanga333/[email protected]
with:
key: "${{ github.event.inputs.type }}"
map: |
{
"hotfix": {
"releaseType": "incrementPatch"
},
"minor": {
"releaseType": "incrementMinor"
},
"major": {
"releaseType": "incrementMajor"
},
".*": {
"releaseType": "invalid"
}
}
- name: Checkout the selected branch
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch }}
fetch-depth: 0
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Local release
run: ./gradlew :createRelease -Prelease.versionIncrementer=${{ env.releaseType }}
- name: Verify build
run: ./gradlew build javadoc
- name: Push release to repository
run: ./gradlew :pushRelease -Prelease.customUsername="${{ secrets.REPO_USER }}" -Prelease.customPassword="${{ secrets.GITHUB_TOKEN }}"
- name: Upload artifacts to Maven Central staging
run: ./gradlew publish :closeAndReleaseStagingRepository -PsigningPassword="${{ secrets.MAVEN_KEY_PASS }}" -PsigningKey="${{ secrets.MAVEN_KEY }}" -PsonatypeUsername="${{ secrets.OSSRH_USER }}" -PsonatypePassword="${{ secrets.OSSRH_PASS }}"