Skip to content

Use env-vars for secrets used during release for ORM and HR (Gradle builds) rather than Project properties #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
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
7 changes: 2 additions & 5 deletions prepare-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,8 @@ if [ "$PROJECT" == "orm" ] || [ "$PROJECT" == "reactive" ]; then
# tags the version
# changes the version to the provided development version
./gradlew clean releasePrepare -x test --no-scan --no-daemon --no-build-cache \
-PreleaseVersion=$RELEASE_VERSION -PdevelopmentVersion=$DEVELOPMENT_VERSION -PgitRemote=origin -PgitBranch=$BRANCH -PdocPublishBranch="production" \
-PSONATYPE_OSSRH_USER=$OSSRH_USER -PSONATYPE_OSSRH_PASSWORD=$OSSRH_PASSWORD \
-Pgradle.publish.key=$PLUGIN_PORTAL_USERNAME -Pgradle.publish.secret=$PLUGIN_PORTAL_PASSWORD \
-PhibernatePublishUsername=$OSSRH_USER -PhibernatePublishPassword=$OSSRH_PASSWORD \
-DsigningPassword=$RELEASE_GPG_PASSPHRASE -DsigningKeyFile=$RELEASE_GPG_PRIVATE_KEY_PATH
-PreleaseVersion=$RELEASE_VERSION -PdevelopmentVersion=$DEVELOPMENT_VERSION
-PgitRemote=origin
else
if [[ "$PROJECT" != "tools" && "$PROJECT" != "hcann" && ! $PROJECT =~ ^infra-.+ ]]; then
# These projects do not have a distribution bundle archive,
Expand Down
18 changes: 12 additions & 6 deletions publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function exec_or_dry_run() {
"${@}"
}
PUSH_CHANGES=true
DRY_RUN=false

while getopts 'dhb:' opt; do
case "$opt" in
Expand All @@ -33,6 +34,7 @@ while getopts 'dhb:' opt; do
d)
# Dry run
echo "DRY RUN: will not push/deploy/publish anything."
DRY_RUN=true
PUSH_CHANGES=false
function exec_or_dry_run() {
echo "DRY RUN; would have executed:" "${@}"
Expand Down Expand Up @@ -77,12 +79,16 @@ RELEASE_VERSION_FAMILY=$(echo "$RELEASE_VERSION" | sed -E 's/^([0-9]+\.[0-9]+).*
if [ "$PROJECT" == "orm" ] || [ "$PROJECT" == "reactive" ]; then
git config user.email ci@hibernate.org
git config user.name Hibernate-CI
exec_or_dry_run ./gradlew releasePerform closeAndReleaseSonatypeStagingRepository -x test --no-scan --no-daemon --no-build-cache \
-PreleaseVersion=$RELEASE_VERSION -PdevelopmentVersion=$DEVELOPMENT_VERSION -PgitRemote=origin -PgitBranch=$BRANCH -PdocPublishBranch=production \
-PSONATYPE_OSSRH_USER=$OSSRH_USER -PSONATYPE_OSSRH_PASSWORD=$OSSRH_PASSWORD \
-Pgradle.publish.key=$PLUGIN_PORTAL_USERNAME -Pgradle.publish.secret=$PLUGIN_PORTAL_PASSWORD \
-PhibernatePublishUsername=$OSSRH_USER -PhibernatePublishPassword=$OSSRH_PASSWORD \
-DsigningPassword=$RELEASE_GPG_PASSPHRASE -DsigningKeyFile=$RELEASE_GPG_PRIVATE_KEY_PATH --stacktrace

EXTRA_ARGS=""
if [ "$DRY_RUN" == "true" ]; then
EXTRA_ARGS=" --dry-run"
fi

./gradlew releasePerform closeAndReleaseSonatypeStagingRepository -x test \
--no-scan --no-daemon --no-build-cache --stacktrace $EXTRA_ARGS \
-PreleaseVersion=$RELEASE_VERSION -PdevelopmentVersion=$DEVELOPMENT_VERSION \
-PdocPublishBranch=production -PgitRemote=origin -PgitBranch=$BRANCH
else
bash -xe "$SCRIPTS_DIR/deploy.sh" "$PROJECT"
if [[ "$PROJECT" != "tools" && "$PROJECT" != "hcann" && ! $PROJECT =~ ^infra-.+ ]]; then
Expand Down