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
35 changes: 30 additions & 5 deletions .github/workflows/java-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ on:
pull_request:
paths:
- .github/workflows/java-publish.yml
workflow_dispatch:
inputs:
dry_run:
description: 'Directly publish the Java artifact under the current version'
required: true
default: false


jobs:
macos-arm64:
Expand Down Expand Up @@ -142,7 +149,9 @@ jobs:
- name: Check glibc version outside docker
run: ldd --version
- name: Build and run in Ubuntu 20.04 container (Dry Run)
if: github.event_name == 'pull_request'
if: |
github.event_name == 'pull_request' ||
inputs.dry_run == 'true'
run: |
docker run --platform linux/amd64 -v ${{ github.workspace }}:/workspace -w /workspace openjdk:8-jdk-buster bash -c "
set -ex
Expand Down Expand Up @@ -207,7 +216,9 @@ jobs:
mvn --batch-mode -DskipTests -Drust.release.build=true package
"
- name: Build and run in Ubuntu 20.04 container (Publish to Sonatype)
if: github.event_name == 'release'
if: |
github.event_name == 'release' ||
inputs.dry_run == 'false'
run: |
docker run --platform linux/amd64 -v ${{ github.workspace }}:/workspace -w /workspace openjdk:8-jdk-buster bash -c "
set -ex
Expand Down Expand Up @@ -271,8 +282,22 @@ jobs:

export SONATYPE_USER=${{ secrets.SONATYPE_USER }}
export SONATYPE_TOKEN=${{ secrets.SONATYPE_TOKEN }}
echo "use-agent" >> ~/.gnupg/gpg.conf
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
export GPG_TTY=$(tty)

mkdir -p /root/.gnupg
touch /root/.gnupg/gpg.conf
cat <<EOF > /root/.gnupg/gpg.conf
use-agent
pinentry-mode loopback
EOF
cat /root/.gnupg/gpg.conf

export GPG_TTY=\$TTY

cat <<EOF > signing.key
${{ secrets.GPG_PRIVATE_KEY }}
EOF
cat signing.key
gpg --import signing.key

mvn --batch-mode -DskipTests -Drust.release.build=true -DpushChanges=false -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} deploy -P deploy-to-ossrh -P shade-jar
"
Loading