-
Notifications
You must be signed in to change notification settings - Fork 153
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
Migrate to PyPI Trusted Publisher for Automated Package Deployment #632
Conversation
WalkthroughThe changes made in the Changes
Sequence Diagram(s)sequenceDiagram
participant CI as CI/CD Workflow
participant Notify as Notify Job
participant Deploy as Deploy PyPI Job
participant Slack as Slack
participant PyPI as PyPI
CI->>Notify: Trigger Notify Job
Notify->>Slack: Send Notification
CI->>Deploy: Trigger Deploy Job
Deploy->>PyPI: Publish Package Distributions
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (2)
.github/workflows/main.yml (2)
97-97
: Consider updating all checkout action versions for consistencyWhile updating to
actions/checkout@v4
is good, there are other instances of the checkout action in this file still using older versions (v3 and v2).Consider updating all instances for consistency:
- uses: actions/checkout@v3 # In test job + uses: actions/checkout@v4 - uses: actions/checkout@v2 # In create-gh-release job + uses: actions/checkout@v4
Line range hint
88-109
: Excellent implementation of PyPI trusted publisher workflowThe migration to PyPI trusted publisher is well-implemented with:
- Proper OIDC authentication setup
- Secure environment configuration
- Removal of API token dependency
This change enhances security by:
- Eliminating the need to store long-lived API tokens
- Using GitHub's OIDC provider for authentication
- Limiting the scope of deployment permissions
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
.github/workflows/main.yml
(3 hunks)
🔇 Additional comments (2)
.github/workflows/main.yml (2)
32-37
: LGTM: Slack notification implementation follows security best practices
The Slack integration is properly configured with:
- Pinned action version
- Secured webhook URL using GitHub secrets
108-109
: LGTM: Improved PyPI publish action configuration
Good improvements:
- Using
release/v1
tag instead of a specific commit hash - More descriptive step name
PR Description:
This PR updates the GitHub Action workflow to use PyPI's trusted publisher mechanism for deploying packages. The changes streamline the publishing process by leveraging GitHub's OpenID Connect (OIDC) authentication, eliminating the need for a separate API token.
Summary of Changes:
__token__
authentication step, as it’s no longer needed with trusted publishing.These updates align with PyPI's trusted publisher requirements, providing a more secure and simplified deployment process.
Summary by CodeRabbit
New Features
deploy-pypi
job has been enhanced with a new environment section for better integration with PyPI.Improvements
deploy-pypi
job to improve deployment efficiency.