- Notifications
You must be signed in to change notification settings - Fork 4.9k
Publish connector command now auto bumps version #11712
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
Changes from all commits
a471823 4f69469 8165b6e 59c8d0a a6e1c97 00d6d01 69c3e9d 29ac307 da3fe5a 0cffdb0 45437a5 0b13dc3 7c30b1a 3d3ccec d3e6f91 10dbe53 11d3220 9f60760 0216753 16a1dde c8dc496 dbf3f5b e98019a 7af9c96 dbcfb70 File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -20,6 +20,10 @@ on: | |
| comment-id: | ||
| description: "The comment-id of the slash command. Used to update the comment with the status." | ||
| required: false | ||
| auto-bump-version: | ||
| description: "after publishing, the workflow will automatically bump the connector version in definitions and generate seed spec" | ||
| required: true | ||
| default: "true" | ||
| | ||
| jobs: | ||
| find_valid_pat: | ||
| | @@ -95,17 +99,25 @@ jobs: | |
| with: | ||
| repository: ${{ github.event.inputs.repo }} | ||
| ref: ${{ github.event.inputs.gitref }} | ||
| token: ${{ secrets.OCTAVIA_PAT }} | ||
| - name: Install Java | ||
| uses: actions/setup-java@v1 | ||
| with: | ||
| java-version: '17' | ||
| java-version: "17" | ||
| - name: Install Pyenv and Tox | ||
| # Beside PyEnv, this does not set any runtimes up because it uses an AMI image that has everything pre-installed. See https://github.com/airbytehq/airbyte/issues/4559/ | ||
| run: | | ||
| python3 -m pip install --quiet virtualenv==16.7.9 --user | ||
| python3 -m virtualenv venv | ||
| source venv/bin/activate | ||
| pip install --quiet tox==3.24.4 | ||
| - name: Install yq | ||
| if: github.event.inputs.auto-bump-version == 'true' && success() | ||
| run: | | ||
| sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CC86BB64 | ||
| sudo add-apt-repository ppa:rmescandon/yq | ||
| sudo apt update | ||
| sudo apt install yq -y | ||
| - name: Test and install CI scripts | ||
| # all CI python packages have the prefix "ci_" | ||
| run: | | ||
| | @@ -118,14 +130,17 @@ jobs: | |
| ci_credentials ${{ github.event.inputs.connector }} | ||
| env: | ||
| GCP_GSM_CREDENTIALS: ${{ secrets.GCP_GSM_CREDENTIALS }} | ||
| - name: Prepare Sentry Release | ||
| - name: Set Name and Version Environment Vars | ||
| if: startsWith(github.event.inputs.connector, 'connectors') | ||
| run: | | ||
| curl -sL https://sentry.io/get-cli/ | bash | ||
| source tools/lib/lib.sh | ||
| DOCKERFILE=airbyte-integrations/${{ github.event.inputs.connector }}/Dockerfile | ||
| echo "IMAGE_NAME=$(echo ${{ github.event.inputs.connector }} | cut -d"/" -f2)" >> $GITHUB_ENV | ||
| echo "IMAGE_VERSION=$(_get_docker_image_version ${DOCKERFILE})" >> $GITHUB_ENV | ||
| - name: Prepare Sentry | ||
| if: startsWith(github.event.inputs.connector, 'connectors') | ||
| run: | | ||
| curl -sL https://sentry.io/get-cli/ | bash | ||
| - name: Create Sentry Release | ||
| if: startsWith(github.event.inputs.connector, 'connectors') | ||
| run: | | ||
| | @@ -153,20 +168,20 @@ jobs: | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_CONNECTOR_RELEASE_AUTH_TOKEN }} | ||
| SENTRY_ORG: airbyte-5j | ||
| SENTRY_PROJECT: airbyte-connectors | ||
| - name: Add Success Comment | ||
| - name: Add Published 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 | ||
| > :rocket: Successfully published ${{github.event.inputs.connector}} | ||
| - name: Add Published 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}} | ||
| > :x: Failed to publish ${{github.event.inputs.connector}} | ||
| - name: Slack Notification - Failure | ||
| if: failure() | ||
| uses: rtCamp/action-slack-notify@master | ||
| | @@ -177,6 +192,63 @@ jobs: | |
| SLACK_COLOR: DC143C | ||
| SLACK_TITLE: "Failed to publish connector ${{ github.event.inputs.connector }} from branch ${{ github.ref }}" | ||
| SLACK_FOOTER: "" | ||
| - name: Check if connector in definitions yaml | ||
| if: github.event.inputs.auto-bump-version == 'true' && success() | ||
| run: | | ||
| connector="airbyte/${{ env.IMAGE_NAME }}" | ||
| Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where's Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I found it's defined in Contributor Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah agreed, will address this | ||
| definitionpath=./airbyte-config/init/src/main/resources/seed/ | ||
| sourcecheck=$(yq e ".. | select(has(\"dockerRepository\")) | select(.dockerRepository == \"$connector\")" "$definitionpath"source_definitions.yaml) | ||
| destcheck=$(yq e ".. | select(has(\"dockerRepository\")) | select(.dockerRepository == \"$connector\")" "$definitionpath"destination_definitions.yaml) | ||
| if [[ (-z "$sourcecheck" && -z "$destcheck") ]] | ||
| then exit 1 | ||
| fi | ||
alafanechere marked this conversation as resolved. Show resolved Hide resolved | ||
| - name: Bump version in definitions yaml | ||
| if: github.event.inputs.auto-bump-version == 'true' && success() | ||
| run: | | ||
| connector="airbyte/${{ env.IMAGE_NAME }}" | ||
| definitionpath=./airbyte-config/init/src/main/resources/seed/ | ||
| sourcename=$(yq e ".[] | select(has(\"dockerRepository\")) | select(.dockerRepository == \"$connector\") | .name" "$definitionpath"source_definitions.yaml) | ||
| destname=$(yq e ".[] | select(has(\"dockerRepository\")) | select(.dockerRepository == \"$connector\") | .name" "$definitionpath"destination_definitions.yaml) | ||
| if [ -z "$sourcename" ] | ||
| then yq e "(.[] | select(.name == \"$destname\").dockerImageTag)|=\"${{ env.IMAGE_VERSION }}\"" -i "$definitionpath"destination_definitions.yaml | ||
| else yq e "(.[] | select(.name == \"$sourcename\").dockerImageTag)|=\"${{ env.IMAGE_VERSION }}\"" -i "$definitionpath"source_definitions.yaml | ||
| fi | ||
| - name: Run gradle process changes | ||
| if: github.event.inputs.auto-bump-version == 'true' && success() | ||
| run: | | ||
| ./gradlew :airbyte-config:init:processResources | ||
| - name: git config | ||
| if: github.event.inputs.auto-bump-version == 'true' && success() | ||
| run: | | ||
| git config user.name 'Octavia Squidington III' | ||
| git config user.email 'octavia-squidington-iii@users.noreply.github.com' | ||
| - name: git commit and push | ||
| if: github.event.inputs.auto-bump-version == 'true' && success() | ||
| run: | | ||
| git add -u | ||
| git commit -m "auto-bump connector version" | ||
| git push origin ${{ github.ref }} | ||
| - name: Add Version Bump Success Comment | ||
| if: github.event.inputs.comment-id && github.event.inputs.auto-bump-version == 'true' && success() | ||
| uses: peter-evans/create-or-update-comment@v1 | ||
| with: | ||
| comment-id: ${{ github.event.inputs.comment-id }} | ||
| body: | | ||
| > :rocket: Auto-bumped version for ${{github.event.inputs.connector}} | ||
| - name: Add Version Bump Failure Comment | ||
| if: github.event.inputs.comment-id && github.event.inputs.auto-bump-version == 'true' && !success() | ||
| uses: peter-evans/create-or-update-comment@v1 | ||
| with: | ||
| comment-id: ${{ github.event.inputs.comment-id }} | ||
| body: | | ||
| > :x: Couldn't auto-bump version for ${{github.event.inputs.connector}} | ||
| - name: Add Final 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}} | ||
| # In case of self-hosted EC2 errors, remove this block. | ||
| stop-publish-image-runner: | ||
| name: Stop Build EC2 Runner | ||
| | ||
Uh oh!
There was an error while loading. Please reload this page.