Skip to content

Commit

Permalink
[ISSUE #22442] fixing race condition in the pipeline (#23670)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxi297 authored Mar 2, 2023
1 parent 09edb20 commit f1ee2c3
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions .github/workflows/publish-cdk-command-manually.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,33 +60,23 @@ jobs:
github-token: ${{ env.PAT }}
label: ${{ github.run_id }}-publisher

bump-version:
if: github.event.inputs.release-type != 'none'
build-cdk:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "17"
- name: Checkout Airbyte
uses: actions/checkout@v3
with:
repository: ${{ github.event.inputs.repo }}
ref: ${{ github.event.inputs.gitref }}
token: ${{ secrets.GH_PAT_MAINTENANCE_OSS }}
- name: "Publish Airbyte CDK: bump version"
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
- name: Commit and Push Changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
file_pattern: airbyte-cdk/python/setup.py airbyte-cdk/python/.bumpversion.cfg airbyte-cdk/python/CHANGELOG.md airbyte-cdk/python/Dockerfile
commit_message: 🤖 Bump ${{ github.event.inputs.release-type }} version of Airbyte CDK
commit_user_name: Octavia Squidington III
commit_user_email: octavia-squidington-iii@users.noreply.github.com
- name: Build CDK Package
run: SUB_BUILD=CDK ./gradlew --no-daemon --no-build-cache :airbyte-cdk:python:build
- name: Post failure to Slack channel dev-connectors-extensibility
if: ${{ failure() }}
uses: slackapi/slack-github-action@v1.23.0
Expand All @@ -95,7 +85,7 @@ jobs:
channel-id: C04J1M66D8B
payload: |
{
"text": "Error during `bump-version` while publishing Airbyte CDK!",
"text": "Error during `build-cdk` while publishing Airbyte CDK!",
"blocks": [
{
"type": "section",
Expand All @@ -116,24 +106,34 @@ jobs:
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN_AIRBYTE_TEAM }}

build-cdk:
needs: bump-version
bump-version:
needs: build-cdk
if: github.event.inputs.release-type != 'none'
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "17"
- name: Checkout Airbyte
uses: actions/checkout@v3
with:
repository: ${{ github.event.inputs.repo }}
ref: ${{ github.event.inputs.gitref }}
- name: Build CDK Package
run: SUB_BUILD=CDK ./gradlew --no-daemon --no-build-cache :airbyte-cdk:python:build
token: ${{ secrets.GH_PAT_MAINTENANCE_OSS }}
- name: "Publish Airbyte CDK: bump version"
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
- name: Commit and Push Changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
file_pattern: airbyte-cdk/python/setup.py airbyte-cdk/python/.bumpversion.cfg airbyte-cdk/python/CHANGELOG.md airbyte-cdk/python/Dockerfile
commit_message: 🤖 Bump ${{ github.event.inputs.release-type }} version of Airbyte CDK
commit_user_name: Octavia Squidington III
commit_user_email: octavia-squidington-iii@users.noreply.github.com
- name: Post failure to Slack channel dev-connectors-extensibility
if: ${{ failure() }}
uses: slackapi/slack-github-action@v1.23.0
Expand All @@ -142,7 +142,7 @@ jobs:
channel-id: C04J1M66D8B
payload: |
{
"text": "Error during `build-cdk` while publishing Airbyte CDK!",
"text": "Error during `bump-version` while publishing Airbyte CDK!",
"blocks": [
{
"type": "section",
Expand Down Expand Up @@ -294,7 +294,7 @@ jobs:
channel-id: C04J1M66D8B
payload: |
{
"text": "Error during `publish-cdk` while publishing Airbyte CDK!",
"text": "Error during `publish-docker-image` while publishing Airbyte CDK!",
"blocks": [
{
"type": "section",
Expand Down

0 comments on commit f1ee2c3

Please sign in to comment.