镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions .github/workflows/build-all-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,17 @@ jobs:
name: Assemble and deploy final all-platforms JAR
runs-on: ubuntu-latest
needs: [ linux, macos, windows ]
env:
# Only publish to Central from v* tags. Releases on Central cannot be removed, and branch or commit builds would
# otherwise deploy SNAPSHOT or commit-hash versions.
PUBLISH: ${{ startsWith(github.ref, 'refs/tags/v') && (github.event_name == 'release' || inputs.publish) }}
steps:
- name: Check publish ref
if: (github.event_name == 'release' || inputs.publish) && env.PUBLISH != 'true'
run: |
echo "::error::Publishing is only allowed from v* tags, not ${GITHUB_REF}"
exit 1

- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
Expand All @@ -226,7 +236,7 @@ jobs:
# with central credentials
- name: Setup Temurin JDK 25 (publish)
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
if: github.event_name == 'release' || inputs.publish
if: env.PUBLISH == 'true'
with:
distribution: temurin
java-version: '25'
Expand All @@ -238,7 +248,7 @@ jobs:
# without central credentials
- name: Setup Temurin JDK 25
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
if: github.event_name != 'release' && !inputs.publish
if: env.PUBLISH != 'true'
with:
distribution: temurin
java-version: '25'
Expand Down Expand Up @@ -284,7 +294,7 @@ jobs:
# with maven central
- name: Build and deploy with Maven
run: ./mvnw -B -C -V -Pdeploy,-native-linux deploy
if: github.event_name == 'release' || inputs.publish
if: env.PUBLISH == 'true'
env:
CENTRAL_TOKEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
CENTRAL_TOKEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
Expand All @@ -293,7 +303,7 @@ jobs:
# without maven central
- name: Build with Maven
run: ./mvnw -B -C -V -P-native-linux verify
if: github.event_name != 'release' && !inputs.publish
if: env.PUBLISH != 'true'

- name: Upload final JAR
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
Expand Down
Loading