📦 Publish to Maven Central #176
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 | |
on: | |
workflow_dispatch: | |
jobs: | |
publish-to-maven-central: | |
runs-on: ubuntu-latest | |
if: "github.event_name == 'workflow_dispatch'" | |
steps: | |
- name: ⬇️ Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Maven Central Repository | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '18' | |
distribution: 'temurin' | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.MAVEN_CENTRAL_GPG_PRIVATE_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: 📦 Publish package | |
run: "./mvnw clean deploy --batch-mode -DskipTests -Pci-cd -pl calculation" | |
env: | |
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_OSSRH_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_CENTRAL_GPG_PASSPHRASE }} |