|  | 
| 6 | 6 | # we have to also update the Trusted Publisher settings on PyPI. | 
| 7 | 7 | 
 | 
| 8 | 8 | name: CDK Publish | 
|  | 9 | +permissions: | 
|  | 10 | +  contents: read | 
| 9 | 11 | 
 | 
| 10 | 12 | on: | 
| 11 | 13 |   push: | 
|  | 
| 31 | 33 |         type: boolean | 
| 32 | 34 |         required: true | 
| 33 | 35 |         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 | 
| 34 | 41 |       update_connector_builder: | 
| 35 | 42 |         description: "Update Connector Builder. If true, the workflow will create a PR to bump the CDK version used by Connector Builder." | 
| 36 | 43 |         type: boolean | 
| @@ -204,18 +211,10 @@ jobs: | 
| 204 | 211 | 
 | 
| 205 | 212 |       - name: "Check for existing tag (version: ${{ env.VERSION || 'none' }} )" | 
| 206 | 213 |         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 }} | 
| 219 | 218 | 
 | 
| 220 | 219 |       - name: "Build and push (sha tag: '${{ github.sha }}')" | 
| 221 | 220 |         # Only run if the version is not set | 
| @@ -250,6 +249,90 @@ jobs: | 
| 250 | 249 |           tags: | | 
| 251 | 250 |             airbyte/source-declarative-manifest:latest | 
| 252 | 251 | 
 | 
|  | 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 | +
 | 
| 253 | 336 |   update-connector-builder: | 
| 254 | 337 |     # Create a PR against the Builder, to update the CDK version that it uses. | 
| 255 | 338 |     # In the future, Builder may use the SDM docker image instead of the Python CDK package. | 
|  | 
0 commit comments