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

Enhance CI workflow to include package publishing to PyPI #48

Merged
merged 7 commits into from
May 7, 2024

Conversation

pabl-o-ce
Copy link
Contributor

This pull request enhances the existing CI workflow to streamline the process and include the publishing of the package to PyPI within the same workflow. The changes made in this PR offer the following improvements:

  1. Consolidated Workflow: The separate publish workflow YAML file has been removed, and the publishing step has been integrated into the main CI workflow. This consolidation simplifies the overall configuration and reduces duplication.

  2. Conditional Publishing: The publishing step is now triggered conditionally based on the release event. By utilizing the on and if keywords, the publishing step is executed only when a release is published. This ensures that the package is published to PyPI only when a new release is created, providing better control over the publishing process.

  3. Artifact Handling: The CI workflow now includes steps to upload and download the built package as an artifact. This allows the publishing job to access the package files without rebuilding them, saving time and resources.

  4. Improved Efficiency: The changes made in this PR streamline the CI and publishing process, reducing the overall execution time and minimizing the maintenance overhead of managing separate workflow files.

The updated CI workflow YAML file now includes the following key components:

  • The on section triggers the workflow on both push events to the main branch and release events with the type published.
  • The build job remains unchanged and is responsible for building the package.
  • An additional step is added to the build job to upload the built package as an artifact.
  • A new publish job is introduced, which depends on the successful completion of the build job.
  • The publish job includes a condition to ensure it only runs when a release is published.
  • The publish job downloads the artifact and uses the pypa/gh-action-pypi-publish action to publish the package to PyPI.

By merging this pull request, the CI workflow will be enhanced to handle both the continuous integration and the publishing of the package to PyPI in a more efficient and streamlined manner.

Please review the changes and provide any feedback or suggestions for further improvements.

@Maximilian-Winter Maximilian-Winter merged commit 5335280 into Maximilian-Winter:master May 7, 2024
2 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.

None yet

2 participants