Enhance CI workflow to include package publishing to PyPI #48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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.
Conditional Publishing: The publishing step is now triggered conditionally based on the release event. By utilizing the
on
andif
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.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.
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:
on
section triggers the workflow on bothpush
events to themain
branch andrelease
events with the typepublished
.build
job remains unchanged and is responsible for building the package.build
job to upload the built package as an artifact.publish
job is introduced, which depends on the successful completion of thebuild
job.publish
job includes a condition to ensure it only runs when a release is published.publish
job downloads the artifact and uses thepypa/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.