Skip to content

Commit

Permalink
[ISSUE airbytehq#22485] testing opening a PR after modifying one file (
Browse files Browse the repository at this point in the history
…airbytehq#23692)

* [ISSUE airbytehq#22485] testing opening a PR after modifying one file

* [ISSUE airbytehq#22485] trying to modify files

* [ISSUE airbytehq#22485] enable automerge (won't work here because version is invalid)

* [ISSUE airbytehq#22485] move to internal repo

* [ISSUE airbytehq#22485] pointing automerge to proper repository

* [ISSUE airbytehq#22485] test job output to pass version

* [ISSUE airbytehq#22485] test unique branch name

* [ISSUE airbytehq#22485] test create-pull-request output

* [ISSUE airbytehq#22485] merging test workflow into real workflow

* [ISSUE airbytehq#22485] adding message on failure to create the PR
  • Loading branch information
maxi297 authored and danielduckworth committed Mar 13, 2023
1 parent 19f6306 commit 19e3666
Showing 1 changed file with 73 additions and 6 deletions.
79 changes: 73 additions & 6 deletions .github/workflows/publish-cdk-command-manually.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ on:
- minor
- patch
required: true
skip-publish-test:
description: 'By default, the job publishes to both Test and actual PyPi. Use "true" to only publish to actual PyPi servers.'
required: false
changelog-message:
description: "Changelog message to be added to CHANGELOG.md"
required: false
Expand Down Expand Up @@ -110,6 +107,8 @@ jobs:
needs: build-cdk
if: github.event.inputs.release-type != 'none'
runs-on: ubuntu-latest
outputs:
new_cdk_version: ${{ steps.bumpversion.outputs.NEW_VERSION }}
steps:
- uses: actions/setup-python@v4
with:
Expand All @@ -121,12 +120,14 @@ jobs:
ref: ${{ github.event.inputs.gitref }}
token: ${{ secrets.GH_PAT_MAINTENANCE_OSS }}
- name: "Publish Airbyte CDK: bump version"
id: bumpversion
run: |
pip install bumpversion
cd airbyte-cdk/python
bumpversion ${{ github.event.inputs.release-type }}
new_version="$(grep -i 'current_version = ' .bumpversion.cfg | sed -e 's/.* = //')"
awk -v NEW_VERSION="$new_version" -v CHANGELOG_MESSAGE="${{ github.event.inputs.changelog-message }}" 'NR==3{print "## " NEW_VERSION "\n" CHANGELOG_MESSAGE "\n"}1' CHANGELOG.md > tmp && mv tmp CHANGELOG.md
echo NEW_VERSION=$new_version >> $GITHUB_OUTPUT
- name: Commit and Push Changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
Expand Down Expand Up @@ -211,7 +212,6 @@ jobs:
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN_AIRBYTE_TEAM }}


publish-docker-image:
timeout-minutes: 240
needs:
Expand Down Expand Up @@ -247,6 +247,59 @@ jobs:
./tools/integrations/manage.sh publish airbyte-cdk/python false
attempt_limit: 3
attempt_delay: 5000 in # ms
- name: Post failure to Slack channel dev-connectors-extensibility
if: ${{ failure() }}
uses: slackapi/slack-github-action@v1.23.0
continue-on-error: true
with:
channel-id: C04J1M66D8B
payload: |
{
"text": "Error during `publish-docker-image` while publishing Airbyte CDK!",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Error while publishing Docker image following Airbyte CDK release!"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "See details on <https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}|GitHub>\n"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN_AIRBYTE_TEAM }}

update-connector-builder:
needs:
- bump-version
- publish-docker-image
runs-on: ubuntu-latest
steps:
- name: Checkout Airbyte Platform Internal
uses: actions/checkout@v3
with:
repository: airbytehq/airbyte-platform-internal
token: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }}
- name: Update CDK version
run: echo ${{needs.bump-version.outputs.new_cdk_version}} > oss/airbyte-connector-builder-server/CDK_VERSION
- name: Create Pull Request
id: create-pull-request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }}
commit-message: Updating CDK version following release
title: Updating CDK version following release
body: This is an automatically generated PR triggered by a CDK release
branch: automatic-cdk-release-${{needs.bump-version.outputs.new_cdk_version}}
base: master
delete-branch: true
- name: Post success to Slack channel dev-connectors-extensibility
uses: slackapi/slack-github-action@v1.23.0
continue-on-error: true
Expand All @@ -263,6 +316,13 @@ jobs:
"text": "A new version of Airbyte CDK has been released with changelog: ${{ github.event.inputs.changelog-message }}!\n\n"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "A PR has also been created for the <${{ steps.create-pull-request.outputs.pull-request-url }}|Connector Builder>\n"
}
},
{
"type": "section",
"text": {
Expand All @@ -282,13 +342,20 @@ jobs:
channel-id: C04J1M66D8B
payload: |
{
"text": "Error during `publish-docker-image` while publishing Airbyte CDK!",
"text": ":warning: A new version of Airbyte CDK has been released but Connector Builder hasn't been automatically updated",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Error while publishing Airbyte CDK!"
"text": "A new version of Airbyte CDK has been released with changelog: ${{ github.event.inputs.changelog-message }}!\n\n"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":warning: Could not automatically create a PR for Connector Builder>\n"
}
},
{
Expand Down

0 comments on commit 19e3666

Please sign in to comment.