-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
144 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,139 @@ | ||
name: Publish CDK Manually | ||
on: | ||
push: | ||
branches: | ||
- issue-19981_avoid-race-condition-on-airbyte-cdk-release | ||
inputs: | ||
repo: | ||
description: "Repo to check out code from. Defaults to the main airbyte repo. Set this when building connectors from forked repos." | ||
required: false | ||
default: "airbytehq/airbyte" | ||
gitref: | ||
description: "The git ref to check out from the specified repository." | ||
required: true | ||
default: issue-19981_avoid-race-condition-on-airbyte-cdk-release | ||
part-to-bump: | ||
description: "Choose the type of version upgrade : major|minor|patch" | ||
required: true | ||
default: patch | ||
workflow_dispatch: | ||
inputs: | ||
repo: | ||
description: "Repo to check out code from. Defaults to the main airbyte repo. Set this when building connectors from forked repos." | ||
required: false | ||
default: "airbytehq/airbyte" | ||
gitref: | ||
description: "The git ref to check out from the specified repository." | ||
required: true | ||
default: issue-19981_avoid-race-condition-on-airbyte-cdk-release | ||
part-to-bump: | ||
type: choice | ||
description: "Choose the type of version upgrade : major|minor|patch" | ||
options: | ||
- major | ||
- minor | ||
- patch | ||
required: true | ||
|
||
jobs: | ||
bump-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
- name: Checkout Airbyte | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ github.event.inputs.repo }} | ||
ref: ${{ github.event.inputs.gitref }} | ||
- name: "Publish Airbyte CDK: bump version" | ||
run: | | ||
pip install bumpversion | ||
cd airbyte-cdk/python | ||
bumpversion ${{ github.event.inputs.part-to-bump }} | ||
- name: Commit and Push Changes | ||
if: success() | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
file_pattern: airbyte-cdk/python/setup.py | ||
commit_message: 🤖 Bump version of Airbyte CDK | ||
commit_user_name: Octavia Squidington III | ||
commit_user_email: octavia-squidington-iii@users.noreply.github.com | ||
|
||
build-cdk: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.9"] | ||
steps: | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- 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=CONNECTORS_BASE ./gradlew --no-daemon --no-build-cache :airbyte-cdk:python:build | ||
- name: Add Failure Comment | ||
if: github.event.inputs.comment-id && !success() | ||
uses: peter-evans/create-or-update-comment@v1 | ||
with: | ||
comment-id: ${{ github.event.inputs.comment-id }} | ||
body: | | ||
> :x: ${{github.event.inputs.connector}} https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} | ||
# publish-cdk: | ||
# needs: build-cdk | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Link comment to workflow run | ||
# if: github.event.inputs.comment-id | ||
# uses: peter-evans/create-or-update-comment@v1 | ||
# with: | ||
# comment-id: ${{ github.event.inputs.comment-id }} | ||
# body: | | ||
# > :clock2: ${{github.event.inputs.connector}} https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} | ||
# # 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 | ||
# uses: mariamrf/py-package-publish-action@v1.1.0 | ||
# 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: ${{ env.pypi_url }} | ||
# - name: Add Success Comment | ||
# if: github.event.inputs.comment-id && success() | ||
# uses: peter-evans/create-or-update-comment@v1 | ||
# with: | ||
# comment-id: ${{ github.event.inputs.comment-id }} | ||
# body: | | ||
# > :white_check_mark: ${{github.event.inputs.connector}} https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} | ||
# - name: Add Failure Comment | ||
# if: github.event.inputs.comment-id && !success() | ||
# uses: peter-evans/create-or-update-comment@v1 | ||
# with: | ||
# comment-id: ${{ github.event.inputs.comment-id }} | ||
# body: | | ||
# > :x: ${{github.event.inputs.connector}} https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[bumpversion] | ||
current_version = 0.17.0 | ||
commit = False | ||
|
||
[bumpversion:file:setup.py] |