Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
26 changes: 18 additions & 8 deletions .github/workflows/prerelease-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,23 @@ jobs:
prerelease-version: ${{ steps.version.outputs.version }}

build-and-publish:
name: Call Publish Workflow
name: Trigger Publish Workflow
needs: [resolve-pr]
uses: ./.github/workflows/pypi_publish.yml
with:
# Use refs/pull/<PR>/head instead of raw SHA for fork compatibility
git_ref: refs/pull/${{ github.event.inputs.pr }}/head
version_override: ${{ needs.resolve-pr.outputs.prerelease-version }}
publish: true
runs-on: ubuntu-latest
steps:
- name: Trigger pypi_publish workflow
id: dispatch
uses: the-actions-org/workflow-dispatch@v4
with:
workflow: pypi_publish.yml
token: ${{ secrets.GITHUB_CI_WORKFLOW_TRIGGER_PAT }}
ref: main # Run from main so OIDC attestation matches trusted publisher
inputs: '{"git_ref": "refs/pull/${{ github.event.inputs.pr }}/head", "version_override": "${{ needs.resolve-pr.outputs.prerelease-version }}", "publish": "true"}'
wait-for-completion: true
wait-for-completion-timeout: 30m
outputs:
workflow-conclusion: ${{ steps.dispatch.outputs.workflow-conclusion }}
workflow-url: ${{ steps.dispatch.outputs.workflow-url }}

post-result-comment:
name: Write Status to PR
Expand All @@ -94,6 +103,7 @@ jobs:
> **Prerelease Published to PyPI**
>
> Version: `${{ needs.resolve-pr.outputs.prerelease-version }}`
> [View publish workflow](${{ needs.build-and-publish.outputs.workflow-url }})
>
> Install with:
> ```bash
Expand All @@ -110,7 +120,7 @@ jobs:
> **Prerelease Build/Publish Failed**
>
> The prerelease encountered an error.
> [Check job output](${{ needs.resolve-pr.outputs.job-run-url }}) for details.
> [Check publish workflow output](${{ needs.build-and-publish.outputs.workflow-url }}) for details.
>
> You can still install directly from this PR branch:
> ```bash
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/pypi_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ on:
push:

workflow_dispatch:
inputs:
git_ref:
description: 'Git ref (SHA or branch) to checkout and build'
required: false
type: string
version_override:
description: 'Version to use (overrides dynamic versioning)'
required: false
type: string
publish:
description: 'Whether to publish to PyPI (true/false)'
required: false
type: string
default: 'false'

workflow_call:
inputs:
Expand Down Expand Up @@ -56,8 +70,8 @@ jobs:
environment:
name: PyPi
url: https://pypi.org/p/airbyte
# Publish when: (1) triggered by a tag push, OR (2) called with publish=true
if: startsWith(github.ref, 'refs/tags/') || inputs.publish == true
# Publish when: (1) triggered by a tag push, OR (2) called with publish=true (handles both boolean and string)
if: startsWith(github.ref, 'refs/tags/') || inputs.publish == true || inputs.publish == 'true'
steps:
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
Expand Down
Loading