-
Notifications
You must be signed in to change notification settings - Fork 645
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci : Add a pipeline for release to maven central
This is taken from Fabric8 Kubernetes Client release pipeline It would take input of release tag and perform release of project at that specific revision. There are some additional inputs as well with java version and additional_args (for release). Signed-off-by: Rohan Kumar <[email protected]>
- Loading branch information
1 parent
af3a6d0
commit 50047d0
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Release to Maven Central | ||
|
||
env: | ||
MAVEN_ARGS: -B -C -V -ntp -Dhttp.keepAlive=false -e ${{ github.event.inputs.additional_args }} | ||
RELEASE_MAVEN_ARGS: -Prelease -DstagingProgressTimeoutMinutes=20 | ||
OSSRHUSERNAME: ${{ secrets.OSSRHUSERNAME }} | ||
OSSRHPASSWORD: ${{ secrets.OSSRHPASSWORD }} | ||
SIGNINGPASSWORD: ${{ secrets.SIGNINGPASSWORD }} | ||
|
||
on: | ||
workflow_dispatch: | ||
input: | ||
tag: | ||
description: Tag to release | ||
required: true | ||
additional_args: | ||
description: Additional Maven Args | ||
required: false | ||
default: '' | ||
java_distribution: | ||
description: Java Distribution to use for release | ||
required: true | ||
default: 'temurin' | ||
|
||
jobs: | ||
release: | ||
name: Release to maven central | ||
# Cheap way to prevent accidental releases | ||
# Modify the list to add users with release permissions | ||
if: contains('["rhuss","rohanKanojia"]', github.actor) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.inputs.tag }} | ||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 11 | ||
distribution: ${{ github.event.inputs.java_distribution }} | ||
server-id: sonatype-nexus-staging | ||
server-username: OSSRHUSERNAME | ||
server-password: OSSRHPASSWORD | ||
gpg-private-key: ${{ secrets.SIGNINGKEY }} | ||
gpg-passphrase: SIGNINGPASSWORD | ||
- name: Build and Release Project | ||
run: ./mvnw ${MAVEN_ARGS} ${RELEASE_MAVEN_ARGS} clean deploy |