-
Notifications
You must be signed in to change notification settings - Fork 71
feat: Add /prerelease slash command for PyPI prereleases
#910
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2162f97
feat: Add /prerelease slash command for TestPyPI prereleases
devin-ai-integration[bot] 4fbe2a7
refactor: Update /prerelease to publish to PyPI and reuse pypi_publis…
devin-ai-integration[bot] b6acdb1
fix: Conditionally set POETRY_DYNAMIC_VERSIONING_BYPASS only when ver…
devin-ai-integration[bot] 488b2ab
refactor: Use explicit step outputs for version override instead of G…
devin-ai-integration[bot] 7b48ddc
refactor: Consolidate success/failure comment jobs into single job wi…
devin-ai-integration[bot] cc5db3f
refactor: Rename jobs to Set up Workflow, Call Publish Workflow, Writ…
devin-ai-integration[bot] 2b57120
refactor: Remove fork check - maintainers can publish from forks if n…
devin-ai-integration[bot] 84361f0
style: Move outputs block to after steps in job definition
devin-ai-integration[bot] 4c42335
fix: Use refs/pull/<PR>/head instead of raw SHA for fork compatibility
devin-ai-integration[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| name: On-Demand Prerelease | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| pr: | ||
| description: 'PR Number' | ||
| type: string | ||
| required: true | ||
| comment-id: | ||
| description: 'Comment ID (Optional)' | ||
| type: string | ||
| required: false | ||
|
|
||
| env: | ||
| AIRBYTE_ANALYTICS_ID: ${{ vars.AIRBYTE_ANALYTICS_ID }} | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| issues: write | ||
|
|
||
| jobs: | ||
| resolve-pr: | ||
| name: Set up Workflow | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| source-repo: ${{ steps.vars.outputs.pr-source-repo-name-full }} | ||
| source-branch: ${{ steps.vars.outputs.pr-source-git-branch }} | ||
| commit-sha: ${{ steps.vars.outputs.pr-source-git-sha }} | ||
| pr-number: ${{ steps.vars.outputs.pr-number }} | ||
| job-run-url: ${{ steps.vars.outputs.run-url }} | ||
| first-comment-id: ${{ steps.first-comment-action.outputs.comment-id }} | ||
| prerelease-version: ${{ steps.version.outputs.version }} | ||
| steps: | ||
| - name: Resolve workflow variables | ||
| id: vars | ||
| uses: aaronsteers/resolve-ci-vars-action@2e56afab0344bbe03c047dfa39bae559d0291472 # v0.1.6 | ||
|
|
||
| - name: Append comment with job run link | ||
| id: first-comment-action | ||
| uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 | ||
| with: | ||
| comment-id: ${{ github.event.inputs.comment-id }} | ||
| issue-number: ${{ github.event.inputs.pr }} | ||
| body: | | ||
| > **Prerelease Build Started** | ||
| > | ||
| > Building and publishing prerelease package from this PR... | ||
| > [Check job output.](${{ steps.vars.outputs.run-url }}) | ||
| - name: Checkout to get latest tag | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Compute prerelease version | ||
| id: version | ||
| run: | | ||
aaronsteers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # Get the latest tag version (strip 'v' prefix if present) | ||
| LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") | ||
| BASE_VERSION=${LATEST_TAG#v} | ||
| # Create a unique prerelease version using PR number and run ID | ||
| # Format: {base}.dev{pr_number}{run_id} (e.g., 0.34.0.dev825123456789) | ||
| PRERELEASE_VERSION="${BASE_VERSION}.dev${{ github.event.inputs.pr }}${{ github.run_id }}" | ||
| echo "version=$PRERELEASE_VERSION" >> $GITHUB_OUTPUT | ||
| echo "Computed prerelease version: $PRERELEASE_VERSION" | ||
| build-and-publish: | ||
| name: Call Publish Workflow | ||
| needs: [resolve-pr] | ||
| uses: ./.github/workflows/pypi_publish.yml | ||
| with: | ||
| git_ref: ${{ needs.resolve-pr.outputs.commit-sha }} | ||
| version_override: ${{ needs.resolve-pr.outputs.prerelease-version }} | ||
| publish: true | ||
aaronsteers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| post-result-comment: | ||
| name: Write Status to PR | ||
| needs: [resolve-pr, build-and-publish] | ||
| if: always() | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Post success comment | ||
| if: needs.build-and-publish.result == 'success' | ||
| uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 | ||
| with: | ||
| comment-id: ${{ needs.resolve-pr.outputs.first-comment-id }} | ||
| issue-number: ${{ github.event.inputs.pr }} | ||
| reactions: rocket | ||
| body: | | ||
| > **Prerelease Published to PyPI** | ||
| > | ||
| > Version: `${{ needs.resolve-pr.outputs.prerelease-version }}` | ||
| > | ||
| > Install with: | ||
| > ```bash | ||
| > pip install airbyte==${{ needs.resolve-pr.outputs.prerelease-version }} | ||
| > ``` | ||
| - name: Post failure comment | ||
| if: needs.build-and-publish.result == 'failure' | ||
| uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 | ||
| with: | ||
| comment-id: ${{ needs.resolve-pr.outputs.first-comment-id }} | ||
| issue-number: ${{ github.event.inputs.pr }} | ||
| reactions: confused | ||
| body: | | ||
| > **Prerelease Build/Publish Failed** | ||
| > | ||
| > The prerelease encountered an error. | ||
| > [Check job output](${{ needs.resolve-pr.outputs.job-run-url }}) for details. | ||
| > | ||
| > You can still install directly from this PR branch: | ||
| > ```bash | ||
| > pip install 'git+https://github.com/${{ needs.resolve-pr.outputs.source-repo }}.git@${{ needs.resolve-pr.outputs.source-branch }}' | ||
| > ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.