44 workflow_dispatch :
55 inputs :
66 RELEASE_VERSION :
7- description : ' Release version (e.g., 0.290 )'
7+ description : ' Release version (e.g., 0.292 )'
88 required : true
9- create_release_tag :
10- description : ' Create release tag'
9+ publish_release_tag :
10+ description : ' Publish release tag'
1111 type : boolean
1212 default : true
1313 required : false
1414 release-notes-commit :
15- description : ' Commit SHA of release notes(required when create_release_tag is checked)'
15+ description : ' Commit SHA of release notes(required when publish_release_tag is checked)'
1616 required : false
1717 publish_maven :
18- description : ' Publish Maven artifacts'
18+ description : ' Publish maven artifacts'
1919 type : boolean
2020 default : true
2121 required : false
2222 publish_docker :
23- description : ' Publish Docker images'
23+ description : ' Publish docker images'
2424 type : boolean
2525 default : true
2626 required : false
2727 publish_native_docker :
28- description : ' Publish Native Docker images'
28+ description : ' Publish native docker images'
2929 type : boolean
3030 default : true
3131 required : false
3232 tag_image_as_latest :
33- description : ' Tag the image as latest version '
33+ description : ' Tag the image as latest'
3434 type : boolean
3535 default : true
3636 required : false
3737 dependency_image :
3838 description : ' Dependency image(e.g., prestodb/presto-native-dependency:0.290-20241014120930-e1fc090)'
3939 required : false
4040 default : ' '
41+ publish_docs :
42+ description : ' Publish docs'
43+ type : boolean
44+ default : true
45+ required : false
4146
4247env :
43- VERSION : ${{ github.event.inputs.RELEASE_VERSION }}
4448 DOCKER_REPO : ${{ github.repository }}
4549 ORG_NAME : ${{ github.repository_owner }}
4650 IMAGE_NAME : presto-native
47- RELEASE_BRANCH : release-${{ github.event. inputs.RELEASE_VERSION }}
48- RELEASE_TAG : ${{ github.event. inputs.RELEASE_VERSION }}
49- RELEASE_NOTES_COMMIT : ${{ github.event. inputs.release-notes-commit }}
51+ RELEASE_BRANCH : release-${{ inputs.RELEASE_VERSION }}
52+ RELEASE_TAG : ${{ inputs.RELEASE_VERSION }}
53+ RELEASE_NOTES_COMMIT : ${{ inputs.release-notes-commit }}
5054
5155jobs :
5256 tag-release :
53- if : ${{ github.event.inputs.create_release_tag == 'true' }}
57+ if : ${{ github.event.inputs.publish_release_tag == 'true' }}
5458 runs-on : ubuntu-latest
5559 environment : release
5660 steps :
5761 - name : Validate release notes commit
5862 if : ${{ github.event.inputs.release-notes-commit == '' }}
5963 run : |
60- echo "Error: release-notes-commit is required when create_release_tag is true"
64+ echo "Error: release-notes-commit is required when publish_release_tag is true"
6165 exit 1
6266
6367 - name : Checkout repository
9296 publish-maven-artifacts :
9397 needs : tag-release
9498 if : |
95- (github.event.inputs.publish_maven == 'true' || github.event.inputs.publish_docker == 'true') &&
96- (github.event.inputs.create_release_tag != 'true' || success())
99+ (github.event.inputs.publish_maven == 'true' || github.event.inputs.publish_docker == 'true' || github.event.inputs.publish_docs == 'true' ) &&
100+ (github.event.inputs.publish_release_tag != 'true' || success())
97101 runs-on : ubuntu-latest
98102 environment : release
99103 timeout-minutes : 60
@@ -120,7 +124,7 @@ jobs:
120124 - name : Checkout code
121125 uses : actions/checkout@v4
122126 with :
123- ref : ${{ env.VERSION }}
127+ ref : ${{ env.RELEASE_TAG }}
124128 token : ${{ secrets.PRESTODB_CI_TOKEN }}
125129 fetch-depth : 0
126130 fetch-tags : true
@@ -169,11 +173,12 @@ jobs:
169173 - name : Upload artifacts
170174 uses : actions/upload-artifact@v4
171175 with :
172- name : presto-artifacts-${{ env.VERSION }}
176+ name : presto-artifacts-${{ env.RELEASE_TAG }}
173177 retention-days : 1
174178 path : |
175179 presto-server/target/presto-server-*.tar.gz
176180 presto-cli/target/presto-cli-*-executable.jar
181+ presto-docs/target/presto-docs-*.zip
177182
178183 - name : Set up GPG key
179184 run : |
@@ -217,12 +222,12 @@ jobs:
217222 - name : Checkout
218223 uses : actions/checkout@v4
219224 with :
220- ref : ${{ env.VERSION }}
225+ ref : ${{ env.RELEASE_TAG }}
221226
222227 - name : Download artifacts
223228 uses : actions/download-artifact@v4
224229 with :
225- name : presto-artifacts-${{ env.VERSION }}
230+ name : presto-artifacts-${{ env.RELEASE_TAG }}
226231 path : ./
227232
228233 - name : Login to dockerhub
@@ -231,13 +236,6 @@ jobs:
231236 username : ${{ secrets.DOCKERHUB_USERNAME }}
232237 password : ${{ secrets.DOCKERHUB_TOKEN }}
233238
234- - name : Login to gitHub container registry
235- 236- with :
237- registry : ghcr.io
238- username : ${{ github.actor }}
239- password : ${{ secrets.PRESTODB_CI_TOKEN }}
240-
241239 - name : Set up qemu
242240 uses : docker/setup-qemu-action@v3
243241
@@ -262,19 +260,17 @@ jobs:
262260 file : docker/Dockerfile
263261 push : true
264262 build-args : |
265- PRESTO_VERSION=${{ env.VERSION }}
263+ PRESTO_VERSION=${{ env.RELEASE_TAG }}
266264 JMX_PROMETHEUS_JAVAAGENT_VERSION=0.20.0
267265 tags : |
268- ${{ env.DOCKER_REPO }}:${{ env.VERSION }}
266+ ${{ env.DOCKER_REPO }}:${{ env.RELEASE_TAG }}
269267 ${{ github.event.inputs.tag_image_as_latest == 'true' && format('{0}:latest', env.DOCKER_REPO) || '' }}
270- ghcr.io/${{ github.repository }}:${{ env.VERSION }}
271- ${{ github.event.inputs.tag_image_as_latest == 'true' && format('ghcr.io/{0}:latest', github.repository) || '' }}
272268
273269 publish-native-images :
274270 needs : tag-release
275271 if : |
276272 github.event.inputs.publish_native_docker == 'true' &&
277- (github.event.inputs.create_release_tag != 'true' || success())
273+ (github.event.inputs.publish_release_tag != 'true' || success())
278274 runs-on : ubuntu-latest
279275 permissions :
280276 contents : read
@@ -287,7 +283,7 @@ jobs:
287283 - name : Checkout
288284 uses : actions/checkout@v4
289285 with :
290- ref : ${{ env.VERSION }}
286+ ref : ${{ env.RELEASE_TAG }}
291287 submodules : true
292288
293289 - name : Initialize Prestissimo submodules
@@ -313,7 +309,7 @@ jobs:
313309 if [[ -n "${{ github.event.inputs.dependency_image }}" ]]; then
314310 echo "DEPENDENCY_IMAGE=${{ github.event.inputs.dependency_image }}" >> $GITHUB_ENV
315311 else
316- echo "DEPENDENCY_IMAGE=ghcr.io/${{ github.repository_owner }}/presto-native-dependency:${{ env.VERSION }}-${{ env.COMMIT_SHA }}" >> $GITHUB_ENV
312+ echo "DEPENDENCY_IMAGE=ghcr.io/${{ github.repository_owner }}/presto-native-dependency:${{ env.RELEASE_TAG }}-${{ env.COMMIT_SHA }}" >> $GITHUB_ENV
317313 fi
318314
319315 - name : Build Dependency Image
@@ -325,43 +321,129 @@ jobs:
325321 else
326322 echo "Building new depedency image"
327323 docker compose build centos-native-dependency
328- docker tag presto/prestissimo-dependency:centos9 ghcr.io/${{ github.repository_owner }}/presto-native-dependency:${{ env.VERSION }}-${{ env.COMMIT_SHA }}
329- docker push ghcr.io/${{ github.repository_owner }}/presto-native-dependency:${{ env.VERSION }}-${{ env.COMMIT_SHA }}
324+ docker tag presto/prestissimo-dependency:centos9 ghcr.io/${{ github.repository_owner }}/presto-native-dependency:${{ env.RELEASE_TAG }}-${{ env.COMMIT_SHA }}
325+ docker push ghcr.io/${{ github.repository_owner }}/presto-native-dependency:${{ env.RELEASE_TAG }}-${{ env.COMMIT_SHA }}
330326 fi
331327 docker images
332328
333329 - name : Build Runtime Image
334330 working-directory : presto-native-execution
335331 run : |
336- if docker pull ghcr.io/${{ github.repository_owner }}/presto-native:${{ env.VERSION }}-${{ env.COMMIT_SHA }}; then
337- docker tag ghcr.io/${{ github.repository_owner }}/presto-native:${{ env.VERSION }}-${{ env.COMMIT_SHA }} docker.io/presto/prestissimo-runtime:centos9
338- else
339- docker compose build centos-native-runtime
340- docker tag presto/prestissimo-runtime:centos9 ghcr.io/${{ github.repository_owner }}/presto-native:${{ env.VERSION }}-${{ env.COMMIT_SHA }}
341- docker push ghcr.io/${{ github.repository_owner }}/presto-native:${{ env.VERSION }}-${{ env.COMMIT_SHA }}
342- fi
332+ docker compose build centos-native-runtime
343333
344334 - name : Add release tag
345335 working-directory : presto-native-execution
346336 run : |
347- docker tag presto/prestissimo-runtime:centos9 ${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
337+ docker tag presto/prestissimo-runtime:centos9 ${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_TAG }}
348338 if [[ "${{ github.event.inputs.tag_image_as_latest }}" == "true" ]]; then
349339 docker tag presto/prestissimo-runtime:centos9 ${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:latest
350340 fi
351341
352342 - name : Push to DockerHub
353343 run : |
354- docker push ${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
344+ docker push ${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_TAG }}
355345 if [[ "${{ github.event.inputs.tag_image_as_latest }}" == "true" ]]; then
356- docker tag ${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} ${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:latest
346+ docker tag ${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_TAG }} ${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:latest
357347 docker push ${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:latest
358348 fi
359349
360- - name : Tag and push to GitHub Packages
350+ publish-docs :
351+ needs : publish-maven-artifacts
352+ if : ${{ github.event.inputs.publish_docs == 'true' && always() }}
353+ runs-on : ubuntu-latest
354+ environment : release
355+
356+ steps :
357+ - name : Checkout presto
358+ uses : actions/checkout@v4
359+ with :
360+ repository : ${{ github.repository_owner }}/presto
361+ path : presto
362+ ref : master
363+ fetch-depth : 0
364+ fetch-tags : true
365+ show-progress : false
366+
367+ - name : Checkout prestodb.github.io
368+ uses : actions/checkout@v4
369+ with :
370+ repository : ${{ github.repository_owner }}/prestodb.github.io
371+ path : prestodb.github.io
372+ ref : source
373+ token : ${{ secrets.PRESTODB_CI_TOKEN }}
374+
375+ - name : Setup Node.js
376+ uses : actions/setup-node@v4
377+ with :
378+ node-version : ' 18.x'
379+
380+ - name : Configure Git
361381 run : |
362- docker tag ${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
363- docker push ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
364- if [[ "${{ github.event.inputs.tag_image_as_latest }}" == "true" ]]; then
365- docker tag ${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest
366- docker push ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest
382+ cd ${{ github.workspace }}/prestodb.github.io
383+ git config --global --add safe.directory ${{ github.workspace }}/prestodb.github.io
384+ git config --global user.email "[email protected] " 385+ git config --global user.name "prestodb-ci"
386+ git log --pretty="format:%ce: %s" -5
387+
388+ - name : Download artifacts
389+ uses : actions/download-artifact@v4
390+ with :
391+ name : presto-artifacts-${{ env.RELEASE_TAG }}
392+ path : ${{ github.workspace }}/build
393+
394+ - name : Update Docs
395+ run : |
396+ cd ${{ github.workspace }}/prestodb.github.io
397+ ls -al
398+
399+ cd website && yarn install && cd ..
400+ LAST_RELEASE_VERSION="0.$((${RELEASE_TAG#0.} - 1))"
401+ echo "Last release version: ${LAST_RELEASE_VERSION}"
402+
403+ TARGET=website/static/docs/${RELEASE_TAG}
404+ CURRENT=website/static/docs/current
405+
406+ if [[ -e ${TARGET} ]]; then
407+ echo "Error: ${TARGET} already exists"
408+ exit 1
367409 fi
410+
411+ mv ${{ github.workspace }}/build/presto-docs/target/presto-docs-${RELEASE_TAG}.zip .
412+ unzip presto-docs-${RELEASE_TAG}.zip | head -n 5
413+ mv html ${TARGET}
414+ unlink ${CURRENT}
415+ ln -sf ${RELEASE_TAG} ${CURRENT}
416+ git add ${TARGET} ${CURRENT}
417+ git status | head -n 5
418+
419+ DATE=$(TZ=America/Los_Angeles date '+%B %d, %Y')
420+ echo "Update the version number and stats in javascript for rendering across the site"
421+ VERSION_JS=website/static/static/js/version.js
422+
423+ echo "const presto_latest_presto_version = '${RELEASE_TAG}';" > ${VERSION_JS}
424+ GIT_LOG="git -C ../presto log --use-mailmap ${LAST_RELEASE_VERSION}..${RELEASE_TAG}"
425+ NUM_COMMITS=$(${GIT_LOG} --format='%aE' | wc -l | awk '{$1=$1;print}')
426+ NUM_CONTRIBUTORS=$(${GIT_LOG} --format='%aE' | sort | uniq | wc -l | awk '{$1=$1;print}')
427+ NUM_COMMITTERS=$(${GIT_LOG} --format='%cE' | sort | uniq | wc -l | awk '{$1=$1;print}')
428+ echo "const presto_latest_num_commits = ${NUM_COMMITS};" >> ${VERSION_JS}
429+ echo "const presto_latest_num_contributors = ${NUM_CONTRIBUTORS};" >> ${VERSION_JS}
430+ echo "const presto_latest_num_committers = ${NUM_COMMITTERS};" >> ${VERSION_JS}
431+ echo "const presto_latest_date = '${DATE}';" >> ${VERSION_JS}
432+ cat ${VERSION_JS}
433+ git add ${VERSION_JS}
434+ git status | head -n 5
435+
436+ - name : Push Updates
437+ run : |
438+ cd ${{ github.workspace }}/prestodb.github.io
439+ git status | head -n 5
440+ git commit -m "Add ${RELEASE_TAG} docs" | head -n 5
441+ git checkout -b "${RELEASE_TAG}-docs"
442+ git push origin "${RELEASE_TAG}-docs"
443+
444+ - name : Create pull request
445+ env :
446+ GH_TOKEN : ${{ secrets.PRESTODB_CI_TOKEN }}
447+ run : |
448+ cd ${{ github.workspace }}/prestodb.github.io
449+ gh pr create --title "Add ${RELEASE_TAG} docs" --body "Add ${RELEASE_TAG} docs" --base source --head "${RELEASE_TAG}-docs"
0 commit comments