Support Stream Branch Publish to the Maven Central Repository #1
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
name: Publish to the Maven Central Repository for Support Stream Branch | |
on: | |
workflow_dispatch: | |
branches: | |
- 'support/**' | |
inputs: | |
version: | |
description: "Version to be released" | |
required: true | |
type: string | |
branch: | |
description: "Branch to be released" | |
required: true | |
type: string | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{github.event.inputs.branch}} | |
token: ${{ secrets.RELEASE_PERSONAL_ACCESS_TOKEN }} | |
- name: Set up JDK | |
uses: actions/setup-java@v4v | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
cache: 'maven' | |
- name: Update version | |
if: ${{ success() }} | |
run: ./mvnw --batch-mode --no-transfer-progress versions:set -DnewVersion=${{github.event.inputs.version}} versions:commit | |
- name: Publish to the Maven Central Repository | |
if: ${{ success() }} | |
run: ./mvnw --batch-mode --no-transfer-progress -Dgib.disable=true -P ossrh -DskipTests deploy | |
env: | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Commit & Push changes | |
if: ${{ success() }} | |
uses: actions-js/push@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
message: 'Release ${{github.event.inputs.version}}' | |
branch: ${{github.event.inputs.branch}} |