66# we have to also update the Trusted Publisher settings on PyPI.
77
88name : CDK Publish
9+ permissions :
10+ contents : read
911
1012on :
1113 push :
3133 type : boolean
3234 required : true
3335 default : true
36+ publish_manifest_server :
37+ description : " Publish Manifest Server to DockerHub. If true, the workflow will publish the Manifest Server to DockerHub."
38+ type : boolean
39+ required : true
40+ default : true
3441 update_connector_builder :
3542 description : " Update Connector Builder. If true, the workflow will create a PR to bump the CDK version used by Connector Builder."
3643 type : boolean
@@ -204,18 +211,10 @@ jobs:
204211
205212 - name : " Check for existing tag (version: ${{ env.VERSION || 'none' }} )"
206213 if : env.VERSION != ''
207- run : |
208- tag="airbyte/source-declarative-manifest:${{ env.VERSION }}"
209- if [ -z "$tag" ]; then
210- echo "Error: VERSION is not set. Ensure the tag follows the format 'refs/tags/vX.Y.Z'."
211- exit 1
212- fi
213- echo "Checking if tag '$tag' exists on DockerHub..."
214- if DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect "$tag" > /dev/null 2>&1; then
215- echo "The tag '$tag' already exists on DockerHub. Skipping publish to prevent overwrite."
216- exit 1
217- fi
218- echo "No existing tag '$tag' found. Proceeding with publish."
214+ uses : ./.github/actions/check-docker-tag
215+ with :
216+ image_name : airbyte/source-declarative-manifest
217+ tag : ${{ env.VERSION }}
219218
220219 - name : " Build and push (sha tag: '${{ github.sha }}')"
221220 # Only run if the version is not set
@@ -250,6 +249,90 @@ jobs:
250249 tags : |
251250 airbyte/source-declarative-manifest:latest
252251
252+ publish_manifest_server :
253+ name : Publish Manifest Server to DockerHub
254+ if : >
255+ (github.event_name == 'push' &&
256+ startsWith(github.ref, 'refs/tags/v')) ||
257+ (github.event_name == 'workflow_dispatch' &&
258+ github.event.inputs.publish_manifest_server == 'true'
259+ )
260+ runs-on : ubuntu-24.04
261+ needs : [build]
262+ environment :
263+ name : DockerHub
264+ url : https://hub.docker.com/r/airbyte/manifest-server/tags
265+ env :
266+ VERSION : ${{ needs.build.outputs.VERSION }}
267+ IS_PRERELEASE : ${{ needs.build.outputs.IS_PRERELEASE }}
268+
269+ steps :
270+ - uses : actions/checkout@v4
271+ with :
272+ fetch-depth : 0
273+
274+ # We need to download the build artifact again because the previous job was on a different runner
275+ - name : Download Build Artifact
276+ uses : actions/download-artifact@v4
277+ with :
278+ name : Packages-${{ github.run_id }}
279+ path : dist
280+
281+ - name : Set up QEMU for multi-platform builds
282+ uses : docker/setup-qemu-action@v3
283+
284+ - name : Set up Docker Buildx
285+ uses : docker/setup-buildx-action@v3
286+
287+ - name : Login to Docker Hub
288+ uses : docker/login-action@v3
289+ with :
290+ username : ${{ secrets.DOCKER_HUB_USERNAME }}
291+ password : ${{ secrets.DOCKER_HUB_PASSWORD }}
292+
293+ - name : " Check for existing tag (version: ${{ env.VERSION || 'none' }} )"
294+ if : env.VERSION != ''
295+ uses : ./.github/actions/check-docker-tag
296+ with :
297+ image_name : airbyte/manifest-server
298+ tag : ${{ env.VERSION }}
299+
300+ - name : " Build and push (sha tag: '${{ github.sha }}')"
301+ # Only run if the version is not set
302+ if : env.VERSION == ''
303+ uses : docker/build-push-action@v5
304+ with :
305+ context : .
306+ file : airbyte_cdk/manifest_server/Dockerfile
307+ platforms : linux/amd64,linux/arm64
308+ push : true
309+ tags : |
310+ airbyte/manifest-server:${{ github.sha }}
311+
312+ - name : " Build and push (version tag: ${{ env.VERSION || 'none'}})"
313+ # Only run if the version is set
314+ if : env.VERSION != ''
315+ uses : docker/build-push-action@v5
316+ with :
317+ context : .
318+ file : airbyte_cdk/manifest_server/Dockerfile
319+ platforms : linux/amd64,linux/arm64
320+ push : true
321+ tags : |
322+ airbyte/manifest-server:${{ env.VERSION }}
323+
324+ - name : Build and push ('latest' tag)
325+ # Only run if version is set and IS_PRERELEASE is false
326+ if : env.VERSION != '' && env.IS_PRERELEASE == 'false'
327+ uses : docker/build-push-action@v5
328+ with :
329+ context : .
330+ file : airbyte_cdk/manifest_server/Dockerfile
331+ platforms : linux/amd64,linux/arm64
332+ push : true
333+ tags : |
334+ airbyte/manifest-server:latest
335+
253336 update-connector-builder :
254337 # Create a PR against the Builder, to update the CDK version that it uses.
255338 # In the future, Builder may use the SDM docker image instead of the Python CDK package.
@@ -275,11 +358,19 @@ jobs:
275358 - uses : actions/setup-python@v5
276359 with :
277360 python-version : " 3.10"
361+ - name : Authenticate as GitHub App
362+ uses : actions/create-github-app-token@v2
363+ id : get-app-token
364+ with :
365+ owner : " airbytehq"
366+ repositories : " airbyte-platform-internal"
367+ app-id : ${{ secrets.OCTAVIA_BOT_APP_ID }}
368+ private-key : ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }}
278369 - name : Checkout Airbyte Platform Internal
279370 uses : actions/checkout@v4
280371 with :
281372 repository : airbytehq/airbyte-platform-internal
282- token : ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }}
373+ token : ${{ steps.get-app-token.outputs.token }}
283374 - name : Update Builder's CDK version to ${{ env.VERSION }}
284375 # PyPI servers aren't immediately updated so we may need to retry a few times.
285376 uses : nick-fields/retry@v3
@@ -293,6 +384,8 @@ jobs:
293384 PREVIOUS_VERSION=$(cat oss/airbyte-connector-builder-resources/CDK_VERSION)
294385 sed -i "s/${PREVIOUS_VERSION}/${VERSION}/g" "oss/airbyte-connector-builder-server/Dockerfile"
295386 sed -i "s/airbyte-cdk==${PREVIOUS_VERSION}/airbyte-cdk==${VERSION}/g" oss/airbyte-connector-builder-server/requirements.in
387+ sed -i "s/tag: ${PREVIOUS_VERSION}/tag: ${VERSION}/g" "oss/charts/v2/airbyte/values.yaml"
388+ sed -i "s/refs\/tags\/v${PREVIOUS_VERSION}/refs\/tags\/v${VERSION}/g" "oss/airbyte-api/manifest-server-api/build.gradle.kts"
296389 echo ${VERSION} > oss/airbyte-connector-builder-resources/CDK_VERSION
297390 cd oss/airbyte-connector-builder-server
298391 python -m pip install --no-cache-dir pip-tools
@@ -301,7 +394,7 @@ jobs:
301394 id : create-pull-request
302395 uses : peter-evans/create-pull-request@v7
303396 with :
304- token : ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }}
397+ token : ${{ steps.get-app-token.outputs.token }}
305398 commit-message : " chore: update CDK version following release"
306399 title : " chore: update CDK version following release"
307400 body : This is an automatically generated PR triggered by a CDK release
0 commit comments