Skip to content

API-DocumentationV3-Publish #3

API-DocumentationV3-Publish

API-DocumentationV3-Publish #3

Workflow file for this run

name: Publish Package to Maven Central Repository
env:
API_HOST: ${{ vars.API_HOST }}
API_KEY: ${{ secrets.API_KEY }}
MAVEN_GPG_KEY: ${{ secrets.MAVEN_GPG_KEY }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.NEXUS_PASSWORD }}
on:
repository_dispatch:
types: [API-DocumentationV3-Publish]
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
jobs:
build-and-publish:
name: >-
Build and Publish
runs-on: gcp-runner
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 1.11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
- name: Build
run: mvn -B package --file pom.xml
- name: Prepare Maven environnement for deployment to Sonatype
run: export MAVEN_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED"
- name: Publish
run: mvn clean deploy
github-release:
name: >-
Upload to Github Release
needs:
- build-and-publish
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""