From 1a85223d9efb48431a2da878433dfa581e8c06f3 Mon Sep 17 00:00:00 2001 From: Aaron Steers Date: Tue, 3 Dec 2024 19:12:54 -0800 Subject: [PATCH 1/3] ci: Don't bump Connector Builder to prerelease CDK versions --- .github/workflows/pypi_publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml index 6325d4882..0117720b2 100644 --- a/.github/workflows/pypi_publish.yml +++ b/.github/workflows/pypi_publish.yml @@ -234,7 +234,7 @@ jobs: needs: - build - publish_cdk - if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.update_connector_builder == 'true') + if: (github.event_name == 'push' && ${{ needs.build.outputs.IS_PRERELEASE == 'false' }} && startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.update_connector_builder == 'true') env: VERSION: ${{ needs.build.outputs.VERSION }} IS_PRERELEASE: ${{ needs.build.outputs.IS_PRERELEASE }} From f347000f30cf20ff70c3cb0db12cb55f9d105e93 Mon Sep 17 00:00:00 2001 From: Aaron Steers Date: Tue, 3 Dec 2024 19:23:08 -0800 Subject: [PATCH 2/3] ci: use multi-line ifs for better readability --- .github/workflows/pypi_publish.yml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml index 0117720b2..272578ac0 100644 --- a/.github/workflows/pypi_publish.yml +++ b/.github/workflows/pypi_publish.yml @@ -115,7 +115,13 @@ jobs: environment: name: PyPi url: https://pypi.org/p/airbyte-cdk/ - if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && (github.event.inputs.publish_to_pypi == 'true' || github.event.inputs.update_connector_builder == 'true')) + if: > + (github.event_name == 'push' && + startsWith(github.ref, 'refs/tags/v')) || + (github.event_name == 'workflow_dispatch' && + (github.event.inputs.publish_to_pypi == 'true' || + github.event.inputs.update_connector_builder == 'true' + )) env: VERSION: ${{ needs.build.outputs.VERSION }} IS_PRERELEASE: ${{ needs.build.outputs.IS_PRERELEASE }} @@ -136,7 +142,10 @@ jobs: file_glob: true - name: Publish to PyPI - if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || github.event.inputs.publish_to_pypi == 'true' + if: > + (github.event_name == 'push' && + startsWith(github.ref, 'refs/tags/v') + ) || github.event.inputs.publish_to_pypi == 'true' uses: pypa/gh-action-pypi-publish@v1.10.3 publish_sdm: @@ -145,7 +154,10 @@ jobs: # (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || # Until then, this workflow needs to be kicked off manually. # Last remaining blocker documented here: https://github.com/airbytehq/airbyte-python-cdk/issues/64 - if: (github.event_name == 'workflow_dispatch' && github.event.inputs.publish_to_dockerhub == 'true') + if: > + (github.event_name == 'workflow_dispatch' && + github.event.inputs.publish_to_dockerhub == 'true' + ) runs-on: ubuntu-latest needs: [build] environment: @@ -234,7 +246,12 @@ jobs: needs: - build - publish_cdk - if: (github.event_name == 'push' && ${{ needs.build.outputs.IS_PRERELEASE == 'false' }} && startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.update_connector_builder == 'true') + if: > + (github.event_name == 'push' && + needs.build.outputs.IS_PRERELEASE == 'false' && + startsWith(github.ref, 'refs/tags/v')) || + (github.event_name == 'workflow_dispatch' && + github.event.inputs.update_connector_builder == 'true') env: VERSION: ${{ needs.build.outputs.VERSION }} IS_PRERELEASE: ${{ needs.build.outputs.IS_PRERELEASE }} From 207cfddbe40ff5d6539fe4d66b06726be4153d9b Mon Sep 17 00:00:00 2001 From: Aaron Steers Date: Tue, 3 Dec 2024 19:28:05 -0800 Subject: [PATCH 3/3] declare environment for Connector Builder --- .github/workflows/pypi_publish.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml index 272578ac0..17fba70ae 100644 --- a/.github/workflows/pypi_publish.yml +++ b/.github/workflows/pypi_publish.yml @@ -243,6 +243,9 @@ jobs: # Create a PR against the Builder, to update the CDK version that it uses. # In the future, Builder may use the SDM docker image instead of the Python CDK package. name: Bump Connector Builder CDK version + environment: + name: Connector Builder + url: https://github.com/airbytehq/airbyte-platform-internal/pulls?q=is%3Apr+automatic-cdk-release+ needs: - build - publish_cdk