-
Notifications
You must be signed in to change notification settings - Fork 40
47 lines (42 loc) · 1.29 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
name: Release maven package
on:
workflow_dispatch:
jobs:
release_maven_package:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Validate branch
if: ${{ github.ref != 'refs/heads/master' }}
run: |
echo "Release can only be triggered from master branch"
exit 1
- uses: actions/checkout@v3
- name: Set up jdk
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '8'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
- name: Configure git config
run: |
git config --global user.name 'Gary Bot 2'
git config --global user.email '[email protected]'
- name: Maven release
run: |
mvn \
-B \
-P release \
release:clean \
release:prepare \
release:perform
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SIGN_KEY: ${{ secrets.SIGN_KEY }}
SIGN_KEY_ID: ${{ secrets.SIGN_KEY_ID }}
SIGN_KEY_PASS: ${{ secrets.SIGN_KEY_PASS }}
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_PASSWORD }}