-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Fix maven publish and add executable jars to github release #25902
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -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 | ||
| tag_image_as_latest: | ||
| description: 'Tag the published images as latest' | ||
| type: boolean | ||
|
|
@@ -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 | ||
|
|
@@ -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: | ||
|
|
@@ -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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
@@ -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 }} | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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_imageinstead to publish the dependency image as well.