Skip to content
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

Publish to PyPi #73

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Publish to PyPi #73

wants to merge 2 commits into from

Conversation

rawkintrevo
Copy link
Contributor

PR Template: Weekly PyPI Release Workflow

Description of Changes

This PR implements a GitHub Actions workflow that:

  • Automatically releases to PyPI every Monday at 00:01 UTC
  • Uses version numbering format: 0.YY.ww (year-week)
  • Creates Git tags with format: v0.YY.ww
  • Uses PyPI trusted publishing for secure deployments

Key features:

  • Scheduled weekly releases with manual trigger option
  • Automatic version number generation based on calendar week
  • Secure publishing via PyPI's trusted publishing system
  • Automatic Git tagging
  • Integrated with Poetry for package building

Related Issues

Closes #30

Testing Performed

  • Verified workflow syntax using IntelliJ
  • Tested version number generation in local environment
  • Validated workflow steps in test repository

Code Changes

  • Added new workflow file: .github/workflows/pypi-release.yml
  • Updated repository permissions for workflow
  • Configured PyPI trusted publisher

Example Usage

The workflow will:

  1. Run automatically every Monday at 00:01 UTC
  2. Generate version number (e.g., 0.24.25 for week 25 of 2024)
  3. Create Git tag (e.g., v0.24.25)

Manual trigger example:

  1. Go to Actions -> Weekly PyPI Release
  2. Click "Run workflow"
  3. Select branch and click "Run workflow"

Checklist

  • Workflow file added to .github/workflows/
  • PyPI trusted publisher configured
  • Repository permissions updated
  • Documentation updated in README.md
  • Tested in staging environment

Additional Context

This implementation:

  • Uses ISO week numbering (Monday start)
  • Maintains consistent version history
  • Provides audit trail through Git tags and GitHub Releases
  • Follows security best practices with trusted publishing

Future improvements:

  • Add pre-release validation steps
  • Add actual release (with release notes, automated)
  • Include changelog generation
  • Add notification system for release status

Signed-off-by: rawkintrevo <trevor.d.grant@gmail.com>
@rawkintrevo rawkintrevo added infra Isseues related to project ops and infrastructure run-tests labels Feb 27, 2025
Copy link

🔍 Found potential issues:

GeneralReview (1 issues)

  1. Overall Impression...

Copy link

GeneralReview:

Overall Impression

The pull request (PR) for implementing a GitHub Actions workflow to publish to PyPI every Monday at 00:01 UTC appears well-structured and thoughtful. The description provides clear details about the changes, including the version numbering format, automatic Git tagging, and the use of PyPI's trusted publishing system for secure deployments. The testing performed and the checklist indicate a methodical approach to ensuring the workflow's functionality and integration. Overall, the code quality seems high, with a focus on automation, security, and consistency.

Strengths

  • Clear Documentation: The PR description and comments are clear and informative, making it easy for reviewers to understand the purpose and functionality of the changes.
  • Automated Processes: The implementation of automated weekly releases, version number generation, and Git tagging streamlines the release process and reduces manual errors.
  • Security Focus: The use of PyPI's trusted publishing system ensures secure deployments, which is crucial for maintaining the integrity of the packages published.
  • Integrated Testing: The testing performed in both local environments and a test repository adds confidence in the workflow's functionality.
  • Consistency and Standards: The adherence to ISO week numbering and the maintenance of a consistent version history are beneficial for tracking and auditing purposes.

Areas for Improvement

  • Error Handling: While the workflow automates several processes, there's limited information on how errors or failures during the workflow execution are handled. Adding robust error handling and notification mechanisms could enhance reliability.
  • Pre-release Validation: As mentioned in the future improvements section, adding pre-release validation steps could help catch potential issues before they reach production, improving overall quality.
  • Release Notes and Changelog: Automating the generation of release notes and a changelog, as suggested, would provide users with clear information about updates and changes, enhancing transparency and user experience.
  • Notification System: Implementing a notification system for release status, as planned, would keep stakeholders informed about the success or failure of releases, facilitating quicker response times to issues.

Special Attention Needed

  • Security Configurations: Given the security implications of publishing to PyPI, special attention should be paid to the configurations of PyPI's trusted publishing system and the repository permissions to ensure they are correctly set up and adhere to the highest security standards.
  • Dependency on External Services: The workflow's dependency on GitHub Actions and PyPI services means that any changes or issues with these services could impact the workflow's functionality. Monitoring these services and having contingency plans in place could mitigate potential disruptions.
  • Version Numbering Strategy: The chosen version numbering strategy (0.YY.ww) should be reviewed to ensure it aligns with the project's long-term goals and doesn't lead to versioning conflicts or issues with dependency management in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infra Isseues related to project ops and infrastructure run-tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Issue] Add automated pypi releases
1 participant