Workflow file for this run
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 Maven Central and Docker Hub | |
on: | |
release: | |
types: [ published ] | |
jobs: | |
publish: | |
environment: mavenCentralPublish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
- name: Setup Java | |
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
- name: Publish to Maven Central | |
run: ./gradlew publishEmbeddedPublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository | |
env: | |
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }} | |
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }} | |
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} | |
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} | |
- name: Push To Docker Hub | |
run: ./gradlew pushOciImage --registry dockerHub --tag . --tag latest # . is a placeholder for the default tag | |
env: | |
ORG_GRADLE_PROJECT_dockerHubUsername: ${{ secrets.DOCKER_USERNAME }} | |
ORG_GRADLE_PROJECT_dockerHubPassword: ${{ secrets.DOCKER_TOKEN }} | |
- name: Attach HiveMQ Zip to GitHub Release | |
run: ./gradlew githubRelease | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |