feat(ci): Add /publish-connectors-prerelease slash command (#70215)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
726b749984
commit
6fe83b03cb
1
.github/pr-welcome-community.md
vendored
1
.github/pr-welcome-community.md
vendored
@@ -21,6 +21,7 @@ As needed or by request, Airbyte Maintainers can execute the following slash com
|
||||
- `/run-live-tests` - Runs live tests for the modified connector(s).
|
||||
- `/run-regression-tests` - Runs regression tests for the modified connector(s).
|
||||
- `/build-connector-images` - Builds and publishes a pre-release docker image for the modified connector(s).
|
||||
- `/publish-connectors-prerelease` - Publishes pre-release connector builds (tagged as `{version}-dev.{git-sha}`) for all modified connectors in the PR.
|
||||
|
||||
If you have any questions, feel free to ask in the PR comments or join our [Slack community](https://airbytehq.slack.com/).
|
||||
|
||||
|
||||
1
.github/pr-welcome-internal.md
vendored
1
.github/pr-welcome-internal.md
vendored
@@ -25,6 +25,7 @@ Airbyte Maintainers (that's you!) can execute the following slash commands on yo
|
||||
- `/run-live-tests` - Runs live tests for the modified connector(s).
|
||||
- `/run-regression-tests` - Runs regression tests for the modified connector(s).
|
||||
- `/build-connector-images` - Builds and publishes a pre-release docker image for the modified connector(s).
|
||||
- `/publish-connectors-prerelease` - Publishes pre-release connector builds (tagged as `{version}-dev.{git-sha}`) for all modified connectors in the PR.
|
||||
- JVM connectors:
|
||||
- `/update-connector-cdk-version connector=<CONNECTOR_NAME>` - Updates the specified connector to the latest CDK version.
|
||||
Example: `/update-connector-cdk-version connector=destination-bigquery`
|
||||
|
||||
127
.github/workflows/publish-connectors-prerelease-command.yml
vendored
Normal file
127
.github/workflows/publish-connectors-prerelease-command.yml
vendored
Normal file
@@ -0,0 +1,127 @@
|
||||
name: Publish Connectors Pre-release
|
||||
# This workflow publishes pre-release connector builds from PR branches.
|
||||
# It can be triggered via the /publish-connectors-prerelease slash command from PR comments.
|
||||
#
|
||||
# Pre-release versions are tagged with the format: {version}-dev.{10-char-git-sha}
|
||||
# These versions are NOT eligible for semver auto-advancement but ARE available
|
||||
# for version pinning via the scoped_configuration API.
|
||||
#
|
||||
# Usage:
|
||||
# /publish-connectors-prerelease
|
||||
#
|
||||
# This will automatically publish all modified connectors in the PR.
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
# Global static-arg inputs for slash commands
|
||||
repo:
|
||||
description: "The repository name"
|
||||
required: false
|
||||
default: "airbytehq/airbyte"
|
||||
type: string
|
||||
gitref:
|
||||
description: "The git reference (branch or tag)"
|
||||
required: false
|
||||
type: string
|
||||
comment-id:
|
||||
description: "The ID of the comment triggering the workflow"
|
||||
required: false
|
||||
type: number
|
||||
pr:
|
||||
description: "The pull request number, if applicable"
|
||||
required: false
|
||||
type: number
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.inputs.pr || github.run_id }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
init:
|
||||
name: Initialize Pre-release Publish
|
||||
runs-on: ubuntu-24.04
|
||||
outputs:
|
||||
run-url: ${{ steps.job-vars.outputs.run-url }}
|
||||
pr-number: ${{ steps.job-vars.outputs.pr-number }}
|
||||
comment-id: ${{ steps.append-start-comment.outputs.comment-id }}
|
||||
short-sha: ${{ steps.get-sha.outputs.short-sha }}
|
||||
steps:
|
||||
- name: Checkout to get commit SHA
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ inputs.repo || github.repository }}
|
||||
ref: ${{ inputs.gitref || '' }}
|
||||
|
||||
- name: Get short SHA
|
||||
id: get-sha
|
||||
run: |
|
||||
SHORT_SHA=$(git rev-parse --short=10 HEAD)
|
||||
echo "short-sha=$SHORT_SHA" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Get job variables
|
||||
id: job-vars
|
||||
run: |
|
||||
echo "run-url=https://github.com/${{ github.repository }}/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_OUTPUT
|
||||
echo "pr-number=${{ inputs.pr }}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Append start comment
|
||||
id: append-start-comment
|
||||
if: inputs.comment-id != ''
|
||||
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
|
||||
with:
|
||||
comment-id: ${{ inputs.comment-id }}
|
||||
issue-number: ${{ steps.job-vars.outputs.pr-number }}
|
||||
reactions: "+1"
|
||||
body: |
|
||||
> **Pre-release Connector Publish Started**
|
||||
>
|
||||
> Publishing pre-release builds for all modified connectors in this PR.
|
||||
> Branch: `${{ inputs.gitref }}`
|
||||
>
|
||||
> Pre-release versions will be tagged as `{version}-dev.${{ steps.get-sha.outputs.short-sha }}`
|
||||
> and are available for version pinning via the scoped_configuration API.
|
||||
>
|
||||
> [View workflow run](${{ steps.job-vars.outputs.run-url }})
|
||||
|
||||
publish:
|
||||
name: Publish Pre-release
|
||||
needs: [init]
|
||||
uses: ./.github/workflows/publish_connectors.yml
|
||||
with:
|
||||
connectors: "--modified"
|
||||
release-type: pre-release
|
||||
secrets: inherit
|
||||
|
||||
post-completion:
|
||||
name: Post Completion Status
|
||||
needs: [init, publish]
|
||||
runs-on: ubuntu-24.04
|
||||
if: always() && inputs.comment-id != ''
|
||||
steps:
|
||||
- name: Determine publish status
|
||||
id: status
|
||||
run: |
|
||||
if [[ "${{ needs.publish.result }}" == "success" ]]; then
|
||||
echo "status_emoji=:white_check_mark:" >> $GITHUB_OUTPUT
|
||||
echo "status_text=SUCCESS" >> $GITHUB_OUTPUT
|
||||
elif [[ "${{ needs.publish.result }}" == "failure" ]]; then
|
||||
echo "status_emoji=:x:" >> $GITHUB_OUTPUT
|
||||
echo "status_text=FAILED" >> $GITHUB_OUTPUT
|
||||
elif [[ "${{ needs.publish.result }}" == "cancelled" ]]; then
|
||||
echo "status_emoji=:warning:" >> $GITHUB_OUTPUT
|
||||
echo "status_text=CANCELLED" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "status_emoji=:grey_question:" >> $GITHUB_OUTPUT
|
||||
echo "status_text=UNKNOWN" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Append completion comment
|
||||
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
|
||||
with:
|
||||
comment-id: ${{ needs.init.outputs.comment-id }}
|
||||
issue-number: ${{ needs.init.outputs.pr-number }}
|
||||
body: |
|
||||
> **Pre-release Publish: ${{ steps.status.outputs.status_text }}** ${{ steps.status.outputs.status_emoji }}
|
||||
>
|
||||
> See workflow run for details and published image tags.
|
||||
1
.github/workflows/slash-commands.yml
vendored
1
.github/workflows/slash-commands.yml
vendored
@@ -42,6 +42,7 @@ jobs:
|
||||
connector-performance
|
||||
format-fix
|
||||
poe
|
||||
publish-connectors-prerelease
|
||||
publish-java-cdk
|
||||
run-cat-tests
|
||||
run-connector-tests
|
||||
|
||||
Reference in New Issue
Block a user