Skip to content

Conversation

@eugmes
Copy link
Owner

@eugmes eugmes commented Nov 18, 2025

@eugmes eugmes requested a review from Copilot November 18, 2025 21:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a GitHub Actions workflow for automated Python package publishing to both PyPI and TestPyPI. The workflow is based on the official Python Packaging Authority guide and implements trusted publishing using OIDC authentication.

Key changes:

  • Automated build pipeline that creates distribution packages on all pull requests and pushes to master
  • Production publishing to PyPI triggered only on tagged releases
  • TestPyPI publishing for all builds to enable testing before production release

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition startsWith(github.ref, 'refs/tags/') will trigger on any tag push, but the workflow trigger specifies only tags matching release-*. This creates inconsistency where the job condition is broader than the trigger pattern. Consider either removing the tag pattern from the trigger (lines 8-9) to allow all tags, or updating the condition to startsWith(github.ref, 'refs/tags/release-') to match the trigger pattern.

Suggested change
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
if: startsWith(github.ref, 'refs/tags/release-') # only publish to PyPI on release-* tag pushes

Copilot uses AI. Check for mistakes.
The file taken from https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/

Set local_scheme = "dirty-tag" for setuptools_scm so that generated
packages could be uploaded to test.pypi.org
@eugmes eugmes merged commit cc0ecea into master Nov 18, 2025
3 checks passed
@eugmes eugmes deleted the add-workflow branch November 18, 2025 22:25
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.

2 participants