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
21 changes: 20 additions & 1 deletion .kokoro/release.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/bin/bash
set -euo pipefail
set -x

# ==============================================================================
# SECURITY NOTICE: DO NOT ADD 'set -x' TO THIS SCRIPT!
# This script handles PGP signing keys and passphrases from Secret Manager.
# Enabling bash xtrace (set -x) will echo credentials into CI logs.
# ==============================================================================
# Explicitly disable xtrace
set +x

REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "${REPO_DIR}"
Expand Down Expand Up @@ -28,6 +35,18 @@ if [[ -z "${SIGNING_KEY:-}" ]]; then
exit 1
fi

if [[ -z "${SIGNING_PASSWORD:-}" ]]; then
echo "=== Fetching GPG signing password from Secret Manager ==="
export SIGNING_PASSWORD="$(gcloud secrets versions access latest \
--secret="bam-devrel-maven-gpg-password" \
--project="bam-devrel-releases")"
fi

if [[ -z "${SIGNING_PASSWORD:-}" ]]; then
echo "ERROR: SIGNING_PASSWORD is not set and could not be fetched from Secret Manager." >&2
exit 1
fi

./gradlew clean check publish --no-daemon

# 2. DRY_RUN Check
Expand Down