Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #19981] testing version bump #21106

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
4ee20b0
[ISSUE #19981] testing version bump
maxi297 Jan 6, 2023
f36e519
[ISSUE #19981] debugging part-to-bump
maxi297 Jan 6, 2023
d2c35d4
[ISSUE #19981] further debugging on part-to-bump
maxi297 Jan 6, 2023
23e8458
[ISSUE #19981] further debugging on part-to-bump yet again
maxi297 Jan 6, 2023
a0c697e
[ISSUE #19981] further debugging on part-to-bump yet again and again
maxi297 Jan 6, 2023
fb290a8
[ISSUE #19981] improving on first successful attempt
maxi297 Jan 6, 2023
63792c0
[ISSUE #19981] adding changelog and concurrency
maxi297 Jan 6, 2023
bf2d56b
Merge branch 'master' into issue-19981_avoid-race-condition-on-airbyt…
maxi297 Jan 6, 2023
0b64541
[ISSUE #19981] update version in .bumpversion.cfg
maxi297 Jan 6, 2023
be5d52a
[ISSUE #19981] testing Slack notification with working channel
maxi297 Jan 9, 2023
971e41f
[ISSUE #19981] documentation and clean up before PR
maxi297 Jan 9, 2023
c9a0a62
Merge branch 'master' into issue-19981_avoid-race-condition-on-airbyt…
maxi297 Jan 9, 2023
ea03997
[ISSUE #19981] make changelog-message optional
maxi297 Jan 9, 2023
90b2225
[ISSUE #19981] align version with new release
maxi297 Jan 9, 2023
710054e
[ISSUE #19981] code review
maxi297 Jan 10, 2023
090ca68
Merge branch 'master' into issue-19981_avoid-race-condition-on-airbyt…
maxi297 Jan 10, 2023
8090168
Merge branch 'master' into issue-19981_avoid-race-condition-on-airbyt…
maxi297 Jan 10, 2023
ffbfdbf
Merge branch 'master' into issue-19981_avoid-race-condition-on-airbyt…
maxi297 Jan 10, 2023
181e6f8
Merge branch 'master' into issue-19981_avoid-race-condition-on-airbyt…
maxi297 Jan 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 111 additions & 0 deletions .github/workflows/publish-cdk-command-manually.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Publish CDK Manually
on:
maxi297 marked this conversation as resolved.
Show resolved Hide resolved
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: false
default: master
release-type:
type: choice
description: "Choose the type of version upgrade : major|minor|patch"
options:
- major
- minor
- patch
- none
required: 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: false

concurrency:
group: publish-airbyte-cdk
cancel-in-progress: false

jobs:
bump-version:
if: github.event.inputs.release-type != 'none'
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.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.release-type }} version of Airbyte CDK
commit_user_name: Octavia Squidington III
commit_user_email: octavia-squidington-iii@users.noreply.github.com

build-cdk:
needs: bump-version
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=CONNECTORS_BASE ./gradlew --no-daemon --no-build-cache :airbyte-cdk:python:build

publish-cdk:
needs: build-cdk
runs-on: ubuntu-latest
steps:
- 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/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: "https://test.pypi.org/legacy/"
- 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 }}
96 changes: 0 additions & 96 deletions .github/workflows/publish-cdk-command.yml

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/slash-commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
publish-connector
publish
publish-external
publish-cdk
gke-kube-test
run-specific-test
static-args: |
Expand Down
5 changes: 5 additions & 0 deletions airbyte-cdk/python/.bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[bumpversion]
current_version = 0.18.1
maxi297 marked this conversation as resolved.
Show resolved Hide resolved
commit = False

[bumpversion:file:setup.py]
5 changes: 2 additions & 3 deletions airbyte-cdk/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,8 @@ and the installation should use your local CDK. Note that the local CDK is injec
**Note:** if your connector uses a `.dockerignore` file, it cannot have `exclude-all` or `exclude-except` patterns, i.e. the `.dockerignore` must specifically say which files to ignore without using any regex.
#### Publishing a new version to PyPi

1. Bump the package version in `setup.py`
2. Open a PR
3. An Airbyte member must comment `/publish-cdk dry-run=true` to publish the package to test.pypi.org or `/publish-cdk dry-run=false` to publish it to the real index of pypi.org.
1. Open a PR
2. Once it is approved and merge, an Airbyte member must run the `Publish CDK Manually` workflow using `release-type=major|manor|patch` and setting the changelog message.

## Coming Soon

Expand Down
5 changes: 2 additions & 3 deletions docs/connector-development/cdk-python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,8 @@ All tests are located in the `unit_tests` directory. Run `pytest --cov=airbyte_c

#### Publishing a new version to PyPi

1. Bump the package version in `setup.py`
2. Open a PR
3. An Airbyte member must comment `/publish-cdk dry-run=true` to publish the package to test.pypi.org or `/publish-cdk dry-run=false` to publish it to the real index of pypi.org.
1. Open a PR
2. Once it is approved and merge, an Airbyte member must run the `Publish CDK Manually` workflow using `release-type=major|manor|patch` and setting the changelog message.

## Coming Soon

Expand Down