Skip to content

Commit 7a93417

Browse files
committed
Add publish dependency image flag to publish release action
1 parent 2dbc230 commit 7a93417

File tree

1 file changed

+28
-17
lines changed

1 file changed

+28
-17
lines changed

.github/workflows/presto-release-publish.yml

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,30 @@ on:
1919
type: boolean
2020
default: true
2121
required: false
22-
publish_docker:
23-
description: 'Publish docker images'
22+
publish_image:
23+
description: 'Publish presto docker image'
2424
type: boolean
2525
default: true
2626
required: false
27-
publish_native_docker:
28-
description: 'Publish native docker images'
27+
publish_native_image:
28+
description: 'Publish prestissimo docker image'
2929
type: boolean
3030
default: true
3131
required: false
32-
tag_image_as_latest:
33-
description: 'Tag the image as latest'
32+
dependency_image:
33+
description: 'prestissimo dependency image(e.g., prestodb/presto-native-dependency:latest)'
34+
required: false
35+
default: ''
36+
publish_native_dep_image:
37+
description: 'Publish prestissimo dependency docker image'
3438
type: boolean
3539
default: true
3640
required: false
37-
dependency_image:
38-
description: 'Dependency image(e.g., prestodb/presto-native-dependency:latest)'
41+
tag_image_as_latest:
42+
description: 'Tag the published images as latest'
43+
type: boolean
44+
default: true
3945
required: false
40-
default: ''
4146
publish_docs:
4247
description: 'Publish docs'
4348
type: boolean
@@ -96,7 +101,7 @@ jobs:
96101
publish-maven-artifacts:
97102
needs: publish-release-tag
98103
if: |
99-
(github.event.inputs.publish_maven == 'true' || github.event.inputs.publish_docker == 'true' || github.event.inputs.publish_docs == 'true') &&
104+
(github.event.inputs.publish_maven == 'true' || github.event.inputs.publish_image == 'true' || github.event.inputs.publish_docs == 'true') &&
100105
(success() || (github.event.inputs.publish_release_tag != 'true' && !failure() && !cancelled()))
101106
runs-on: ubuntu-latest
102107
environment: release
@@ -210,9 +215,9 @@ jobs:
210215
-Pdeploy-to-ossrh \
211216
-pl '!presto-test-coverage'
212217
213-
publish-docker-images:
218+
publish-docker-image:
214219
needs: publish-maven-artifacts
215-
if: github.event.inputs.publish_docker == 'true' && !failure() && !cancelled()
220+
if: github.event.inputs.publish_image == 'true' && !failure() && !cancelled()
216221
runs-on: ubuntu-latest
217222
environment: release
218223
timeout-minutes: 150
@@ -267,10 +272,10 @@ jobs:
267272
${{ env.DOCKER_REPO }}:${{ env.RELEASE_TAG }}
268273
${{ github.event.inputs.tag_image_as_latest == 'true' && format('{0}:latest', env.DOCKER_REPO) || '' }}
269274
270-
publish-native-images:
275+
publish-native-image:
271276
needs: publish-release-tag
272277
if: |
273-
github.event.inputs.publish_native_docker == 'true' &&
278+
github.event.inputs.publish_native_image == 'true' &&
274279
(success() || (github.event.inputs.publish_release_tag != 'true' && !failure() && !cancelled()))
275280
runs-on: ubuntu-latest
276281
permissions:
@@ -315,8 +320,15 @@ jobs:
315320
else
316321
echo "Building new depedency image"
317322
docker compose build centos-native-dependency
318-
docker tag presto/prestissimo-dependency:centos9 ${{ github.repository_owner }}/presto-native-dependency:${{ env.RELEASE_TAG }}-${{ env.COMMIT_SHA }}
319-
docker push ${{ github.repository_owner }}/presto-native-dependency:${{ env.RELEASE_TAG }}-${{ env.COMMIT_SHA }}
323+
if [[ "${{ github.event.inputs.publish_native_dep_image }}" == "true" ]]; then
324+
docker tag presto/prestissimo-dependency:centos9 ${{ github.repository_owner }}/presto-native-dependency:${{ env.RELEASE_TAG }}-${{ env.COMMIT_SHA }}
325+
docker push ${{ github.repository_owner }}/presto-native-dependency:${{ env.RELEASE_TAG }}-${{ env.COMMIT_SHA }}
326+
327+
if [[ "${{ github.event.inputs.tag_image_as_latest }}" == "true" ]]; then
328+
docker tag presto/prestissimo-dependency:centos9 ${{ github.repository_owner }}/presto-native-dependency:latest
329+
docker push ${{ github.repository_owner }}/presto-native-dependency:latest
330+
fi
331+
fi
320332
fi
321333
docker images
322334
@@ -442,4 +454,3 @@ jobs:
442454
run: |
443455
cd ${{ github.workspace }}/prestodb.github.io
444456
gh pr create --title "Add ${RELEASE_TAG} docs" --body "Add ${RELEASE_TAG} docs" --base source --head "${RELEASE_TAG}-docs"
445-

0 commit comments

Comments
 (0)