Skip to content

Commit 4ef367a

Browse files
committed
Consolidate release workflow into ci-publish.yml
Remove duplicate release-central.yml. Fix secret name (CENTRAL_PASSWORD → CENTRAL_TOKEN) and add versions:set step to derive release version from tag.
1 parent 33684fd commit 4ef367a

2 files changed

Lines changed: 10 additions & 65 deletions

File tree

.github/workflows/ci-publish.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,17 @@ jobs:
3939
cache: maven
4040
server-id: central
4141
server-username: CENTRAL_USERNAME
42-
server-password: CENTRAL_PASSWORD
42+
server-password: CENTRAL_TOKEN
4343
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
4444
gpg-passphrase: GPG_PASSPHRASE
4545

46+
- name: Set release version from tag
47+
if: startsWith(github.ref, 'refs/tags/v')
48+
run: |
49+
VERSION=${GITHUB_REF_NAME#v}
50+
echo "Publishing version: $VERSION"
51+
mvn versions:set -DnewVersion=$VERSION -DgenerateBackupPoms=false
52+
4653
- name: Install beagle.jar to local Maven repo
4754
run: >
4855
mvn install:install-file
@@ -78,8 +85,8 @@ jobs:
7885

7986
- name: Publish to Maven Central
8087
if: startsWith(github.ref, 'refs/tags/v')
81-
run: mvn deploy -P release -DskipTests
88+
run: mvn deploy -Prelease -DskipTests
8289
env:
8390
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
84-
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
91+
CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }}
8592
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

.github/workflows/release-central.yml

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)