-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'issue-19981_avoid-race-condition-on-airbyte-cdk-release…
…' into issue-19981_notifications-on-publish-cdk-manually
- Loading branch information
Showing
4 changed files
with
27 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ on: | |
description: "The git ref to check out from the specified repository." | ||
required: false | ||
default: master | ||
part-to-bump: | ||
release-type: | ||
type: choice | ||
description: "Choose the type of version upgrade : major|minor|patch" | ||
options: | ||
|
@@ -19,25 +19,20 @@ on: | |
- patch | ||
- none | ||
required: true | ||
dry-run: | ||
type: choice | ||
description: 'By default dry-run publishes to Test PyPi. Use "false" to publish to actual PyPi servers.' | ||
options: | ||
- true | ||
- false | ||
required: true | ||
default: true | ||
skip-publish-test: | ||
description: 'By default, the job publishes to Test PyPi. Use "true" to only publish to actual PyPi servers.' | ||
required: false | ||
changelog-message: | ||
description: "Changelog message to be added to CHANGELOG.md" | ||
required: true | ||
required: false | ||
|
||
concurrency: | ||
group: publish-airbyte-cdk | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
bump-version: | ||
if: github.event.inputs.part-to-bump != 'none' | ||
if: github.event.inputs.release-type != 'none' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-python@v4 | ||
|
@@ -52,15 +47,15 @@ jobs: | |
run: | | ||
pip install bumpversion | ||
cd airbyte-cdk/python | ||
bumpversion ${{ github.event.inputs.part-to-bump }} | ||
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 | ||
if: success() | ||
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 | ||
commit_message: 🤖 Bump ${{ github.event.inputs.part-to-bump }} version of Airbyte CDK | ||
commit_message: 🤖 Bump ${{ github.event.inputs.release-type }} version of Airbyte CDK | ||
commit_user_name: Octavia Squidington III | ||
commit_user_email: [email protected] | ||
- name: Post failure to Slack channel dev-connectors-extensibility | ||
|
@@ -77,7 +72,7 @@ jobs: | |
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "Error while publishing Airbyte CDK with dry-run=${{ github.event.inputs.dry-run }}!" | ||
"text": "Error while publishing Airbyte CDK!" | ||
} | ||
}, | ||
{ | ||
|
@@ -124,7 +119,7 @@ jobs: | |
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "Error while publishing Airbyte CDK with dry-run=${{ github.event.inputs.dry-run }}!" | ||
"text": "Error while publishing Airbyte CDK!" | ||
} | ||
}, | ||
{ | ||
|
@@ -143,18 +138,23 @@ jobs: | |
needs: build-cdk | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Make use of env vars to dynamically set the PyPi url. Since the default is set to publish to production PyPi, only set the url if during | ||
# a dry-run publish to the Test PyPi servers. | ||
- name: Set PyPi URL | ||
if: github.event.inputs.dry-run != 'false' | ||
run: | | ||
echo ${{ github.event.inputs.dry-run }} | ||
echo "pypi_url=https://test.pypi.org/legacy/" >> $GITHUB_ENV | ||
- name: Checkout Airbyte | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ github.event.inputs.repo }} | ||
ref: ${{ github.event.inputs.gitref }} | ||
- name: Publish Python Package to test.pypi.org | ||
if: github.event.inputs.skip-publish-test != 'true' | ||
uses: mariamrf/[email protected] | ||
with: | ||
# specify the same version as in ~/.python-version | ||
python_version: "3.9.11" | ||
pip_version: "21.1" | ||
subdir: "airbyte-cdk/python/" | ||
env: | ||
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} | ||
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} | ||
TWINE_REPOSITORY_URL: "https://test.pypi.org/legacy/" | ||
- name: Publish Python Package | ||
uses: mariamrf/[email protected] | ||
with: | ||
|
@@ -165,9 +165,8 @@ jobs: | |
env: | ||
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} | ||
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} | ||
TWINE_REPOSITORY_URL: ${{ env.pypi_url }} | ||
- name: Post success to Slack channel dev-connectors-extensibility | ||
if: github.event.inputs.dry-run == 'false' && success() | ||
if: success() | ||
uses: slackapi/[email protected] | ||
continue-on-error: true | ||
with: | ||
|
@@ -208,7 +207,7 @@ jobs: | |
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "Error while publishing Airbyte CDK with dry-run=${{ github.event.inputs.dry-run }}!" | ||
"text": "Error while publishing Airbyte CDK!" | ||
} | ||
}, | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[bumpversion] | ||
current_version = 0.18.0 | ||
current_version = 0.18.1 | ||
commit = False | ||
|
||
[bumpversion:file:setup.py] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters