Skip to content

Commit ea19b6f

Browse files
committed
[skip-central] release without central
1 parent 55464c6 commit ea19b6f

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

.github/workflows/maven-publish.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ jobs:
1818
with:
1919
myToken: ${{ secrets.GITHUB_TOKEN }}
2020

21+
- name: Check commit message
22+
id: commit_check
23+
run: |
24+
if git log -1 --pretty=%B | grep -q "\[skip-central\]"; then
25+
echo "skip_central=true" >> $GITHUB_OUTPUT
26+
else
27+
echo "skip_central=false" >> $GITHUB_OUTPUT
28+
fi
29+
2130
- name: Set up JDK 21
2231
uses: actions/setup-java@v5
2332
with:
@@ -28,14 +37,22 @@ jobs:
2837
server-username: MAVEN_USERNAME
2938
server-password: MAVEN_PASSWORD
3039

31-
- name: Build with Maven
40+
- name: Build with Maven (Deploy to Central)
41+
if: steps.commit_check.outputs.skip_central == 'false'
3242
run: mvn clean deploy -P central -Dgpg.signer=bc
3343
env:
3444
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
3545
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
3646
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
3747
MAVEN_GPG_KEY: ${{ secrets.GPG_SECRET_KEY }}
3848

49+
- name: Build with Maven (Skip Central)
50+
if: steps.commit_check.outputs.skip_central == 'true'
51+
run: mvn clean package
52+
env:
53+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
54+
MAVEN_GPG_KEY: ${{ secrets.GPG_SECRET_KEY }}
55+
3956
- name: Generate Javadocs
4057
run: mvn javadoc:aggregate-no-fork
4158
- name: Deploy Javadocs

0 commit comments

Comments
 (0)