Skip to content

Add PyPI publish workflow with reusable build-wheels#7

Merged
shaia merged 1 commit intomasterfrom
feature/publish-workflow
Nov 30, 2025
Merged

Add PyPI publish workflow with reusable build-wheels#7
shaia merged 1 commit intomasterfrom
feature/publish-workflow

Conversation

@shaia
Copy link
Copy Markdown
Owner

@shaia shaia commented Nov 30, 2025

  • Add workflow_call trigger to build-wheels.yml for reusability
  • Create publish.yml that reuses build-wheels workflow
  • Support release, tag push (v*), and manual dispatch triggers
  • Publish to TestPyPI (manual) or PyPI (release/tag)
  • Use trusted publishing (OIDC) for secure authentication
  • Clean up debug steps from build-wheels workflow

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR establishes an automated PyPI publishing pipeline for the cfd-python package, implementing secure OIDC-based authentication and supporting multiple deployment targets (PyPI, TestPyPI) with flexible trigger mechanisms.

Key Changes:

  • Created a new publish.yml workflow that orchestrates wheel building, source distribution creation, and publishing to PyPI/TestPyPI
  • Made build-wheels.yml reusable via workflow_call trigger and removed debug/diagnostic steps
  • Implemented OIDC trusted publishing for secure, token-less authentication with PyPI registries

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
.github/workflows/publish.yml New workflow that builds wheels/sdist and publishes to PyPI or TestPyPI based on release events, tag pushes, or manual triggers
.github/workflows/build-wheels.yml Added workflow_call trigger for reusability, added CFD_USE_STABLE_ABI environment variable, and cleaned up debug logging steps

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
Copy link

Copilot AI Nov 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The artifact uploads in the build jobs don't specify a retention period. For a publish workflow that may run frequently (especially with manual dispatch), consider adding retention-days to prevent excessive artifact storage costs.

Example:

- uses: actions/upload-artifact@v4
  with:
    name: sdist
    path: dist/*.tar.gz
    retention-days: 5
Suggested change
path: dist/*.tar.gz
path: dist/*.tar.gz
retention-days: 5

Copilot uses AI. Check for mistakes.
Comment on lines +60 to +61
permissions:
id-token: write
Copy link

Copilot AI Nov 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The publish jobs have id-token: write for OIDC authentication, but they may also need contents: read permission to properly interact with release artifacts and repository content when triggered by release events.

Consider adding:

permissions:
  id-token: write
  contents: read

Copilot uses AI. Check for mistakes.
Comment on lines +93 to +94
permissions:
id-token: write
Copy link

Copilot AI Nov 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The publish jobs have id-token: write for OIDC authentication, but they may also need contents: read permission to properly interact with release artifacts and repository content when triggered by release events.

Consider adding:

permissions:
  id-token: write
  contents: read

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +8
push:
tags:
- 'v*'
Copy link

Copilot AI Nov 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The release trigger and push with tags: v* may fire simultaneously when a GitHub release is published (since releases create tags). This could result in duplicate workflow runs attempting to publish the same version to PyPI.

Consider using only the release trigger for production releases, or add logic to prevent duplicate publishes (e.g., using a workflow concurrency group or removing one of the triggers).

Suggested change
push:
tags:
- 'v*'

Copilot uses AI. Check for mistakes.
- Add workflow_call trigger to build-wheels.yml for reusability
- Create publish.yml that reuses build-wheels workflow
- Support release, tag push (v*), and manual dispatch triggers
- Publish to TestPyPI (manual) or PyPI (release/tag)
- Use trusted publishing (OIDC) for secure authentication
- Clean up debug steps from build-wheels workflow
@shaia shaia force-pushed the feature/publish-workflow branch from 27dabdb to 375b7df Compare November 30, 2025 18:08
@shaia shaia merged commit 35a57bd into master Nov 30, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants