Skip to content

Commit d6558c9

Browse files
committed
more
1 parent c149b89 commit d6558c9

File tree

1 file changed

+97
-0
lines changed

1 file changed

+97
-0
lines changed

.github/workflows/pypi_publish.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ on:
3131
type: boolean
3232
required: true
3333
default: true
34+
publish_manifest_runner:
35+
description: "Publish Manifest Runner to DockerHub. If true, the workflow will publish the Manifest Runner to DockerHub."
36+
type: boolean
37+
required: true
38+
default: true
3439
update_connector_builder:
3540
description: "Update Connector Builder. If true, the workflow will create a PR to bump the CDK version used by Connector Builder."
3641
type: boolean
@@ -250,6 +255,98 @@ jobs:
250255
tags: |
251256
airbyte/source-declarative-manifest:latest
252257
258+
publish_manifest_runner:
259+
name: Publish Manifest Runner to DockerHub
260+
if: >
261+
(github.event_name == 'push' &&
262+
startsWith(github.ref, 'refs/tags/v')) ||
263+
(github.event_name == 'workflow_dispatch' &&
264+
github.event.inputs.publish_manifest_runner == 'true'
265+
)
266+
runs-on: ubuntu-24.04
267+
needs: [build]
268+
environment:
269+
name: DockerHub
270+
url: https://hub.docker.com/r/airbyte/manifest-runner/tags
271+
env:
272+
VERSION: ${{ needs.build.outputs.VERSION }}
273+
IS_PRERELEASE: ${{ needs.build.outputs.IS_PRERELEASE }}
274+
275+
steps:
276+
- uses: actions/checkout@v4
277+
with:
278+
fetch-depth: 0
279+
280+
# We need to download the build artifact again because the previous job was on a different runner
281+
- name: Download Build Artifact
282+
uses: actions/download-artifact@v4
283+
with:
284+
name: Packages-${{ github.run_id }}
285+
path: dist
286+
287+
- name: Set up QEMU for multi-platform builds
288+
uses: docker/setup-qemu-action@v3
289+
290+
- name: Set up Docker Buildx
291+
uses: docker/setup-buildx-action@v3
292+
293+
- name: Login to Docker Hub
294+
uses: docker/login-action@v3
295+
with:
296+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
297+
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
298+
299+
- name: "Check for existing tag (version: ${{ env.VERSION || 'none' }} )"
300+
if: env.VERSION != ''
301+
run: |
302+
tag="airbyte/manifest-runner:${{ env.VERSION }}"
303+
if [ -z "$tag" ]; then
304+
echo "Error: VERSION is not set. Ensure the tag follows the format 'refs/tags/vX.Y.Z'."
305+
exit 1
306+
fi
307+
echo "Checking if tag '$tag' exists on DockerHub..."
308+
if DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect "$tag" > /dev/null 2>&1; then
309+
echo "The tag '$tag' already exists on DockerHub. Skipping publish to prevent overwrite."
310+
exit 1
311+
fi
312+
echo "No existing tag '$tag' found. Proceeding with publish."
313+
314+
- name: "Build and push (sha tag: '${{ github.sha }}')"
315+
# Only run if the version is not set
316+
if: env.VERSION == ''
317+
uses: docker/build-push-action@v5
318+
with:
319+
context: .
320+
file: airbyte_cdk/manifest_runner/Dockerfile
321+
platforms: linux/amd64,linux/arm64
322+
push: true
323+
tags: |
324+
airbyte/manifest-runner:${{ github.sha }}
325+
326+
- name: "Build and push (version tag: ${{ env.VERSION || 'none'}})"
327+
# Only run if the version is set
328+
if: env.VERSION != ''
329+
uses: docker/build-push-action@v5
330+
with:
331+
context: .
332+
file: airbyte_cdk/manifest_runner/Dockerfile
333+
platforms: linux/amd64,linux/arm64
334+
push: true
335+
tags: |
336+
airbyte/manifest-runner:${{ env.VERSION }}
337+
338+
- name: Build and push ('latest' tag)
339+
# Only run if version is set and IS_PRERELEASE is false
340+
if: env.VERSION != '' && env.IS_PRERELEASE == 'false'
341+
uses: docker/build-push-action@v5
342+
with:
343+
context: .
344+
file: airbyte_cdk/manifest_runner/Dockerfile
345+
platforms: linux/amd64,linux/arm64
346+
push: true
347+
tags: |
348+
airbyte/manifest-runner:latest
349+
253350
update-connector-builder:
254351
# Create a PR against the Builder, to update the CDK version that it uses.
255352
# In the future, Builder may use the SDM docker image instead of the Python CDK package.

0 commit comments

Comments
 (0)