这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@leomaurodesenv
Copy link
Owner

🚀 Add Automated Deployment Workflow to PyPI

Description

This pull request introduces a comprehensive GitHub Actions workflow (.github/workflows/deployment.yml) to automate the testing, building, and deployment of the scikit-sampling library.

The new workflow establishes a full Continuous Integration and Continuous Deployment (CI/CD) pipeline, ensuring that every change is validated and that releases to PyPI are seamless and reliable.

Workflow Breakdown

The workflow is composed of several sequential jobs that run on ubuntu-22.04 and leverage the high-performance uv tool for all package management tasks:

  1. pre-commit:

    • Trigger: Runs on all pull requests and pushes to main.
    • Action: Executes pre-commit run --all-files to enforce code style, formatting, and other quality checks across the entire repository.
  2. tests:

    • Trigger: Runs on all pull requests and pushes to main.
    • Action: Installs all dependencies and runs the full pytest suite, including coverage checks, to ensure the library's functionality is correct and to prevent regressions.
  3. build:

    • Trigger: Runs only on pushes to the main branch, after pre-commit and tests have passed successfully.
    • Action: Builds the source distribution (sdist) and wheel (.whl) using uv build and archives them as artifacts.
  4. deploy:

    • Trigger: Runs only after a successful build on the main branch.
    • Action: Downloads the packaged artifacts and publishes them to PyPI using uv publish. This step is protected and requires the UV_PUBLISH_TOKEN secret, ensuring that only authorized changes to main result in a new release.

Benefits

  • Automation: Fully automates the release process, eliminating manual steps and reducing the risk of human error.
  • Quality Assurance: Guarantees that all code merged into main passes both linting and all tests before a release is even considered.
  • Immediate Feedback: Pull requests are automatically checked, providing quick feedback to contributors.

This workflow is a critical step in professionalizing the project's development and release cycle.

@leomaurodesenv leomaurodesenv self-assigned this Jun 28, 2025
@leomaurodesenv leomaurodesenv added the enhancement New feature or request label Jun 28, 2025
@leomaurodesenv leomaurodesenv merged commit a78d8a2 into main Jun 28, 2025
4 checks passed
@leomaurodesenv leomaurodesenv deleted the feat/build-package branch June 28, 2025 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants