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
117 changes: 75 additions & 42 deletions .github/workflows/presto-release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ on:
type: boolean
default: true
required: false
publish_github_release:
description: 'Publish executable jars to github release'
type: boolean
default: true
required: false
publish_image:
description: 'Publish presto docker image'
type: boolean
Expand All @@ -33,11 +38,6 @@ on:
description: 'prestissimo dependency image(e.g., prestodb/presto-native-dependency:latest)'
required: false
default: ''
publish_native_dep_image:
description: 'Publish prestissimo dependency docker image'
type: boolean
default: true
required: false
Comment on lines -36 to -40
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems github action has the limit of 10 parameters, so removed this one and use publish_native_image instead to publish the dependency image as well.

tag_image_as_latest:
description: 'Tag the published images as latest'
type: boolean
Expand Down Expand Up @@ -102,8 +102,12 @@ jobs:
publish-maven-artifacts:
needs: publish-release-tag
if: |
(!failure() &&!cancelled()) &&
(github.event.inputs.publish_maven == 'true' || github.event.inputs.publish_image == 'true' || github.event.inputs.publish_docs == 'true')
(!failure() &&!cancelled()) && (
github.event.inputs.publish_maven == 'true' ||
github.event.inputs.publish_image == 'true' ||
github.event.inputs.publish_docs == 'true' ||
github.event.inputs.publish_github_release == 'true'
)
runs-on: ubuntu-latest
environment: release
timeout-minutes: 60
Expand Down Expand Up @@ -181,18 +185,8 @@ jobs:
</settings>
EOL

- name: Maven build
run: mvn clean install -DskipTests

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: presto-artifacts-${{ env.RELEASE_TAG }}
retention-days: 1
path: |
presto-server/target/presto-server-*.tar.gz
presto-cli/target/presto-cli-*-executable.jar
presto-docs/target/presto-docs-*.zip
- name: Build release artifacts
run: ./mvnw clean install -DskipTests

- name: Set up GPG key
env:
Expand All @@ -213,28 +207,67 @@ jobs:
GPG_PASSPHRASE: "${{ secrets.GPG_PASSPHRASE }}"
run: |
unset MAVEN_CONFIG
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
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
./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 \
-DdeploymentName=presto-${{ env.RELEASE_TAG }} \
-Drelease.autoPublish=${{ env.MAVEN_AUTO_PUBLISH }} \
-DskipExecutableJar \
-Poss-release \
-Pdeploy-to-ossrh \
-pl '!presto-test-coverage'

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: presto-artifacts-${{ env.RELEASE_TAG }}
retention-days: 7
path: |
presto-server/target/presto-server-*.tar.gz
presto-docs/target/presto-docs-*.zip
presto-cli/target/presto-cli-*-executable.jar
presto-benchmark-driver/target/presto-benchmark-driver-*-executable.jar
presto-testing-server-launcher/target/presto-testing-server-launcher-*-executable.jar
Comment on lines +234 to +236
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Upload the executable jar files to publish in github release


publish-github-release:
needs: publish-maven-artifacts
if: (!failure() && !cancelled()) && github.event.inputs.publish_github_release == 'true'
runs-on: ubuntu-latest
environment: release
timeout-minutes: 150
permissions:
packages: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ env.RELEASE_TAG}}

- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: presto-artifacts-${{ env.RELEASE_TAG }}
path: ./

- name: Create github release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.RELEASE_TAG }}
name: Presto ${{ env.RELEASE_TAG }}
token: ${{ secrets.PRESTODB_CI_TOKEN }}
body: |
See the release notes at https://prestodb.io/docs/current/release/release-${{ env.RELEASE_TAG }}.html
files: |
./presto-cli/target/presto-cli-*-executable.jar
./presto-benchmark-driver/target/presto-benchmark-driver-*-executable.jar
./presto-testing-server-launcher/target/presto-testing-server-launcher-*-executable.jar

publish-docker-image:
needs: publish-maven-artifacts
Expand Down Expand Up @@ -349,7 +382,7 @@ jobs:
else
echo "Building new depedency image"
docker compose build centos-native-dependency
if [[ "${{ github.event.inputs.publish_native_dep_image }}" == "true" ]]; then
if [[ "${{ github.event.inputs.publish_native_image }}" == "true" ]]; then
docker tag presto/prestissimo-dependency:centos9 ${{ github.repository_owner }}/presto-native-dependency:${{ env.RELEASE_TAG }}-${{ env.COMMIT_SHA }}
docker push ${{ github.repository_owner }}/presto-native-dependency:${{ env.RELEASE_TAG }}-${{ env.COMMIT_SHA }}

Expand Down
Loading