Skip to content

Publish package to the Maven Central Repository #25

Publish package to the Maven Central Repository

Publish package to the Maven Central Repository #25

Workflow file for this run

name: Publish package to the Maven Central Repository
on: workflow_dispatch
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Clojure tools
uses: DeLaGuardo/[email protected]
with:
lein: 'latest'
- name: "Build JAR files"
run: lein uberjar
- name: "Generate pom.xml"
run: lein pom
- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish package
run: |
JAR_FILE=$(ls target/kpow-streams-agent-*.jar | grep -v "standalone" | head -n 1)
mvn --batch-mode \
-Dsource=1.8 \
-Dtarget=1.8 \
-Dmaven.compiler.source=1.8 \
-Dmaven.compiler.target=1.8 \
-Dfile=$JAR_FILE \
deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_KEY_PASSPHRASE }}