Skip to content

Commit e16cbef

Browse files
committed
Add more flags
1 parent f7d9580 commit e16cbef

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

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

+26-7
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,31 @@ on:
66
RELEASE_VERSION:
77
description: 'Release version (e.g., 0.290)'
88
required: true
9-
publish_as_latest:
10-
description: 'Also publish as latest version'
9+
publish_maven:
10+
description: 'Publish Maven artifacts'
11+
type: boolean
12+
default: true
13+
required: false
14+
publish_docker:
15+
description: 'Publish Docker images'
16+
type: boolean
17+
default: true
18+
required: false
19+
publish_native_docker:
20+
description: 'Publish Native Docker images'
21+
type: boolean
22+
default: true
23+
required: false
24+
tag_image_as_latest:
25+
description: 'Tag the image as latest version'
1126
type: boolean
1227
default: true
1328
required: false
1429
dependency_image:
1530
description: 'Dependency image(e.g., prestodb/presto-native-dependency:0.290-20241014120930-e1fc090)'
1631
required: false
1732
default: ''
33+
1834
env:
1935
VERSION: ${{ github.event.inputs.RELEASE_VERSION }}
2036
DOCKER_REPO: ${{ github.repository }}
@@ -49,6 +65,7 @@ jobs:
4965
presto-cli/target/presto-cli-*-executable.jar
5066
5167
publish-maven-artifacts:
68+
if: ${{ github.event.inputs.publish_maven == 'true' }}
5269
runs-on: ubuntu-latest
5370
environment: release
5471
timeout-minutes: 30
@@ -156,6 +173,7 @@ jobs:
156173
presto-cli/target/presto-cli-*-executable.jar
157174
158175
publish-docker-images:
176+
if: ${{ github.event.inputs.publish_docker == 'true' }}
159177
needs: [maven-build]
160178
runs-on: ubuntu-latest
161179
environment: release
@@ -215,11 +233,12 @@ jobs:
215233
JMX_PROMETHEUS_JAVAAGENT_VERSION=0.20.0
216234
tags: |
217235
${{ env.DOCKER_REPO }}:${{ env.VERSION }}
218-
${{ github.event.inputs.publish_as_latest == 'true' && format('{0}:latest', env.DOCKER_REPO) || '' }}
236+
${{ github.event.inputs.tag_image_as_latest == 'true' && format('{0}:latest', env.DOCKER_REPO) || '' }}
219237
ghcr.io/${{ github.repository }}:${{ env.VERSION }}
220-
${{ github.event.inputs.publish_as_latest == 'true' && format('ghcr.io/{0}:latest', github.repository) || '' }}
238+
${{ github.event.inputs.tag_image_as_latest == 'true' && format('ghcr.io/{0}:latest', github.repository) || '' }}
221239
222240
publish-native-image:
241+
if: ${{ github.event.inputs.publish_native_docker == 'true' }}
223242
needs: [maven-build]
224243
runs-on: ubuntu-latest
225244
permissions:
@@ -290,14 +309,14 @@ jobs:
290309
working-directory: presto-native-execution
291310
run: |
292311
docker tag presto/prestissimo-runtime:centos9 ${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
293-
if [[ "${{ github.event.inputs.publish_as_latest }}" == "true" ]]; then
312+
if [[ "${{ github.event.inputs.tag_image_as_latest }}" == "true" ]]; then
294313
docker tag presto/prestissimo-runtime:centos9 ${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:latest
295314
fi
296315
297316
- name: Push to DockerHub
298317
run: |
299318
docker push ${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
300-
if [[ "${{ github.event.inputs.publish_as_latest }}" == "true" ]]; then
319+
if [[ "${{ github.event.inputs.tag_image_as_latest }}" == "true" ]]; then
301320
docker tag ${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} ${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:latest
302321
docker push ${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:latest
303322
fi
@@ -306,7 +325,7 @@ jobs:
306325
run: |
307326
docker tag ${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
308327
docker push ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
309-
if [[ "${{ github.event.inputs.publish_as_latest }}" == "true" ]]; then
328+
if [[ "${{ github.event.inputs.tag_image_as_latest }}" == "true" ]]; then
310329
docker tag ${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest
311330
docker push ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest
312331
fi

0 commit comments

Comments
 (0)