-
Notifications
You must be signed in to change notification settings - Fork 10
51 lines (45 loc) · 1.87 KB
/
release.yml
File metadata and controls
51 lines (45 loc) · 1.87 KB
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
# This workflow will build a package using Maven and then publish it to Maven central when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
name: Release
on:
workflow_dispatch:
inputs:
dry_run:
type: boolean
required: true
default: false
description: "If true, no Git changes will be made and no artifacts will be uploaded."
release_version:
type: string
required: false
description: "Set the release version. If not specified, the version in the pom.xml will be released."
development_version:
type: string
required: false
description: "Set the next development version. If not specified, the minor version will be incremented automatically."
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '25'
distribution: 'temurin'
server-id: central
server-username: MAVEN_CENTRAL_TOKEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish to Maven central
run: |
git config user.name Shapeshifter
git config user.email shapeshifter@lfenergy.org
mvn -B -DdryRun=${{inputs.dry_run}} -DreleaseVersion=${{inputs.release_version}} -DdevelopmentVersion=${{inputs.development_version}} release:prepare release:perform
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
MAVEN_CENTRAL_TOKEN_USERNAME: ${{ vars.MAVEN_CENTRAL_TOKEN_USERNAME }}
MAVEN_CENTRAL_TOKEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_TOKEN_PASSWORD }}