Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
1 change: 1 addition & 0 deletions .github/pr-welcome-community.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ As needed or by request, Airbyte Maintainers can execute the following slash com
- `/autofix` - Fixes most formatting and linting issues
- `/poetry-lock` - Updates poetry.lock file
- `/test` - Runs connector tests with the updated CDK
- `/prerelease` - Triggers a prerelease publish with default arguments

If you have any questions, feel free to ask in the PR comments or join our [Slack community](https://airbytehq.slack.com/).
1 change: 1 addition & 0 deletions .github/pr-welcome-internal.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Airbyte Maintainers can execute the following slash commands on your PR:
- `/autofix` - Fixes most formatting and linting issues
- `/poetry-lock` - Updates poetry.lock file
- `/test` - Runs connector tests with the updated CDK
- `/prerelease` - Triggers a prerelease publish with default arguments
- `/poe build` - Regenerate git-committed build artifacts, such as the pydantic models which are generated from the manifest JSON schema in YAML.
- `/poe <command>` - Runs any poe command in the CDK environment

Expand Down
90 changes: 90 additions & 0 deletions .github/workflows/prerelease-command.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: On-Demand Prerelease

on:
workflow_dispatch:
inputs:
pr:
description: "PR Number"
type: string
required: false
comment-id:
description: "Comment ID (Optional)"
type: string
required: false

jobs:
prerelease-on-demand:
name: Trigger Prerelease Publish
runs-on: ubuntu-24.04
steps:
Comment thread
coderabbitai[bot] marked this conversation as resolved.
- name: Authenticate as GitHub App
uses: actions/create-github-app-token@v2
id: get-app-token
with:
owner: "airbytehq"
repositories: "airbyte-python-cdk"
app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }}
private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }}

- name: Create URL to the run output
id: vars
run: echo "run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_OUTPUT

- name: Append comment with job run link
if: github.event.inputs.comment-id
id: first-comment-action
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ github.event.inputs.comment-id }}
issue-number: ${{ github.event.inputs.pr }}
body: |
> **Prerelease Job Info**
>
> This job triggers the publish workflow with default arguments to create a prerelease.
>
> Prerelease job started... [Check job output.][1]

[1]: ${{ steps.vars.outputs.run-url }}

- name: Trigger publish workflow
run: |
gh workflow run publish.yml \
Comment thread
aaronsteers marked this conversation as resolved.
Outdated
--ref ${{ github.ref }} \
Comment thread
aaronsteers marked this conversation as resolved.
Outdated
-f version="" \
-f publish_to_pypi=true \
-f publish_to_dockerhub=true \
-f publish_manifest_server=true \
-f update_connector_builder=false
Comment thread
aaronsteers marked this conversation as resolved.
Outdated
env:
GH_TOKEN: ${{ steps.get-app-token.outputs.token }}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

- name: Get workflow run URL
id: workflow-url
run: |
# Wait a moment for the workflow to be created
sleep 5
# Get the most recent workflow run for publish.yml
WORKFLOW_RUN_URL=$(gh run list --workflow=publish.yml --limit=1 --json url --jq '.[0].url')
Comment thread
aaronsteers marked this conversation as resolved.
Outdated
echo "workflow-run-url=${WORKFLOW_RUN_URL}" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ steps.get-app-token.outputs.token }}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

- name: Append success comment
if: github.event.inputs.comment-id
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.first-comment-action.outputs.comment-id }}
reactions: hooray
body: |
> ✅ Prerelease workflow triggered successfully.
>
> View the publish workflow run: ${{ steps.workflow-url.outputs.workflow-run-url }}

- name: Append failure comment
if: failure() && github.event.inputs.comment-id
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.first-comment-action.outputs.comment-id }}
reactions: confused
body: |
> ❌ Failed to trigger prerelease workflow.
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Comment thread
aaronsteers marked this conversation as resolved.
6 changes: 4 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ on:
Note that this workflow is intended for prereleases. For public-facing stable releases,
please use the GitHub Releases workflow instead:
https://github.com/airbytehq/airbyte-python-cdk/blob/main/docs/RELEASES.md.
For prereleases, please leave the version blank to use the detected version. Alternatively,
you can override the dynamic versioning for special use cases.
For prereleases, you can use the /prerelease slash command in a PR comment to trigger
this workflow with default arguments. Alternatively, you can manually trigger this workflow
and leave the version blank to use the detected version, or override the dynamic versioning
for special use cases.
required: false
publish_to_pypi:
description: "Publish to PyPI. If true, the workflow will publish to PyPI."
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/slash_command_dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
test
poetry-lock
poe
prerelease

# Notes regarding static-args:
# - Slash commands can be invoked from both issues and comments.
Expand Down Expand Up @@ -63,6 +64,7 @@ jobs:
- \`/autofix\` - Corrects any linting or formatting issues
- \`/test\` - Runs the test suite
- \`/poetry-lock\` - Re-locks dependencies and updates the poetry.lock file
- \`/prerelease\` - Triggers a prerelease publish with default arguments
- \`/help\` - Shows this help message"

if [[ "${{ github.event.comment.body }}" == "/help" ]]; then
Expand Down
Loading