-
Notifications
You must be signed in to change notification settings - Fork 7
56 lines (52 loc) · 2.03 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: Create Release
on:
workflow_dispatch:
inputs:
releaseVersion:
description: 'The release version. Ex: 1.6.0'
required: true
developmentVersion:
description: 'The next development version. Ex: 1.7.0-SNAPSHOT'
required: true
permissions:
contents: write
jobs:
release:
name: Create Release
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
# to bypass the branch protection rule for maven-release-plugin
# see https://github.community/t/push-to-restricted-master-branch/18191/2
persist-credentials: false
- name: Configure Git user
run: |
git config user.email "[email protected]"
git config user.name "CI Bot"
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
java-package: 'jdk'
check-latest: true
server-id: 'ossrh' # must match the serverId configured for the nexus-staging-maven-plugin
server-username: OSSRH_USERNAME # Env var that holds your OSSRH user name
server-password: OSSRH_PASSWORD # Env var that holds your OSSRH user pw
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Substituted with the value stored in the referenced secret
gpg-passphrase: SIGN_KEY_PASS # Env var that holds the key's passphrase
cache: 'maven'
- name: Release
run: |
./mvnw -DskipTests -Darguments="-DskipTests" \
-Dusername=cibot -Dpassword=${{ secrets.GITHUB_TOKEN }} \
-DdevelopmentVersion=${{ github.event.inputs.developmentVersion }} \
-DreleaseVersion=${{ github.event.inputs.releaseVersion }} \
-B release:prepare release:perform -P deploy
env:
SIGN_KEY_PASS: ${{ secrets.GPG_PASSPHRASE }}
OSSRH_USERNAME: ${{ secrets.NEXUS_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}