-
Notifications
You must be signed in to change notification settings - Fork 4
50 lines (44 loc) · 1.54 KB
/
prepare-maven-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
name: Create Maven Release
on:
workflow_dispatch:
inputs:
releaseVersion:
description: "Release Version:"
required: true
developmentVersion:
description: "Next Development Version:"
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# with:
# token: ${{ github.token }}
- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Configure Git User
run: |
git config user.email ${{ github.actor }}@users.noreply.github.com
git config user.name ${{ github.actor }}
- name: Prepare Release
run: mvn -B release:prepare -DreleaseVersion=${{ github.event.inputs.releaseVersion }} -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }}
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ github.token }}
- name: Push Release
run: |
git push
git push --tags
- name: Build and Publish SNAPSHOT to the Maven Central
run: mvn -B clean install deploy -DskipTests -DdeployAtEnd=true
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
SIGN_KEY: ${{ secrets.SIGN_KEY }}
SIGN_KEY_PASS: ${{ secrets.SIGN_KEY_PASS }}