From 5b3eb0509acaf592ca562ac0f1ea9ddde1de65a4 Mon Sep 17 00:00:00 2001 From: Niels Bertram Date: Sun, 8 Oct 2023 11:55:41 +1000 Subject: [PATCH] add maven central release workflow --- .github/workflows/maven-release.yaml | 30 ++++++++++++++++++++++++++++ pom.xml | 13 +++++++----- 2 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/maven-release.yaml diff --git a/.github/workflows/maven-release.yaml b/.github/workflows/maven-release.yaml new file mode 100644 index 0000000..5ece7b0 --- /dev/null +++ b/.github/workflows/maven-release.yaml @@ -0,0 +1,30 @@ +--- +name: Publish package to the Maven Central Repository +on: + release: + types: [ created ] + push: + branches: + - main + - develop + - releases/** + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Maven Central + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: corretto + cache: maven + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: Publish Package + run: mvn --batch-mode --no-transfer-progress clean deploy + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} diff --git a/pom.xml b/pom.xml index 9651575..5877e16 100644 --- a/pom.xml +++ b/pom.xml @@ -40,7 +40,7 @@ niels.bertram@fares.io https://plus.google.com/+NielsBertram fares.io - http://fares.io/ + https://fares.io/ @@ -59,11 +59,11 @@ ossrh - https://oss.sonatype.org/content/repositories/snapshots + https://s01.oss.sonatype.org/content/repositories/snapshots/ ossrh - https://oss.sonatype.org/service/local/staging/deploy/maven2/ + https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ @@ -318,8 +318,8 @@ true ossrh - https://oss.sonatype.org/ - true + https://s01.oss.sonatype.org/ + false @@ -382,6 +382,9 @@ true ossrh + + remove +