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: 23 additions & 12 deletions .github/workflows/presto-release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ env:
RELEASE_NOTES_COMMIT: ${{ inputs.release-notes-commit }}
GIT_CI_USER: ${{ vars.GIT_CI_USER || 'prestodb-ci' }}
GIT_CI_EMAIL: ${{ vars.GIT_CI_EMAIL || '[email protected]' }}
MAVEN_AUTO_PUBLISH: ${{ vars.MAVEN_AUTO_PUBLISH || 'true' }}

jobs:
publish-release-tag:
Expand Down Expand Up @@ -212,18 +213,28 @@ jobs:
GPG_PASSPHRASE: "${{ secrets.GPG_PASSPHRASE }}"
run: |
unset MAVEN_CONFIG
./mvnw -s ${{ github.workspace }}/settings.xml -V -B -U -e -T1C deploy \
-Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}" \
-Dmaven.wagon.http.retryHandler.count=8 \
-DskipTests \
-DstagingProfileId="${{ secrets.MAVEN_STAGING_PROFILE_ID }}" \
-DkeepStagingRepositoryOnFailure=true \
-DkeepStagingRepositoryOnCloseRuleFailure=true \
-DautoReleaseAfterClose=true \
-DstagingProgressTimeoutMinutes=60 \
-Poss-release \
-Pdeploy-to-ossrh \
-pl '!presto-test-coverage'
modules=$(find . -maxdepth 1 -type d \( ! -name . \) -exec test -f '{}/pom.xml' \; -print | sed 's|^./||')
for module in $modules; do
if [ "$module" = "presto-test-coverage" ]; then
echo "Skipping $module"
continue
fi
MODULE_PATH=$(awk -F'[<>]' '/^ <groupId>/ {print $3; exit}' "$module/pom.xml" | sed 's|\.|/|g' | sed 's|^com/facebook/presto||')
echo "Checking https://repo1.maven.org/maven2/com/facebook/presto${MODULE_PATH}/${module}/${RELEASE_TAG}"
if ! curl --silent --fail "https://repo1.maven.org/maven2/com/facebook/presto${MODULE_PATH}/${module}/${RELEASE_TAG}" > /dev/null; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would happen if there's a timeout here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine, there are 2 cases:

  1. For this release, since we disabled the auto publish, it will upload the artifacts and do the validation when the curl command failed. If we get error, we can drop the uploaded artifacts and try again.

  2. For future release, if enabled auto publish, when the curl command failed, we can re-run the action after other published modules visible in the maven repo.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For number 2, how would we know that we ended skipping a module?

Copy link
Contributor Author

@unidevel unidevel Aug 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we will miss any module, because it will try to publish the module if the curl command failed for any reason.

echo "Publishing ${module}"
./mvnw -s ${{ github.workspace }}/settings.xml -V -B -U -e -T1C deploy \
-Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}" \
-Dmaven.wagon.http.retryHandler.count=8 \
-DskipTests \
-Drelease.autoPublish=${{ env.MAVEN_AUTO_PUBLISH }} \
-Poss-release \
-Pdeploy-to-ossrh \
-pl "$module"
else
echo "${module} ${RELEASE_TAG} already published, skipping."
fi
done

publish-docker-image:
needs: publish-maven-artifacts
Expand Down
Loading