Skip to content

Conversation

@CJHwong
Copy link
Member

@CJHwong CJHwong commented Sep 23, 2025

Reason

Enable automated PyPI package publishing through GitHub Actions to streamline the release process and reduce manual errors.

Changes

GitHub Actions Workflow (.github/workflows/publish.yml)

  • Automated PyPI publishing triggered by GitHub releases
  • Manual workflow dispatch option for testing (TestPyPI or PyPI)
  • Build artifact validation before publishing
  • Simple API token authentication (no complex OIDC setup)
  • Mutually exclusive publish steps to prevent double publishing

Deployment Documentation (DEPLOYMENT.md)

  • Comprehensive deployment guide with two methods:
    • Automated via GitHub Actions (recommended)
    • Manual deployment using twine
  • Step-by-step setup instructions for PyPI tokens
  • Multiple credential management options (environment variables, .pypirc, direct pass)
  • Troubleshooting guide for common issues
  • Quick reference for common deployment tasks

Test Scope

  • ✅ Tested workflow logic locally with custom test script
  • ✅ Verified conditional logic (no double publishing)
  • ✅ Validated build process creates both wheel and source dist
  • ✅ Confirmed artifact validation catches missing files
  • ✅ All code snippets in documentation tested and verified

Checks

  • Unit tests are included or not applicable.
  • Documentation is complete and accurate
  • Workflow syntax validated
  • Build and validation steps tested locally

- Add GitHub Actions workflow for automated PyPI publishing
  - Supports both release and manual trigger
  - Validates build artifacts before publishing
  - Supports both production and test PyPI
- Add comprehensive DEPLOYMENT.md documentation
  - Step-by-step deployment instructions
  - Multiple authentication options
  - Troubleshooting guide
  - Quick reference for common tasks
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 enables automated PyPI package publishing through GitHub Actions to streamline the release process and reduce manual errors. It provides comprehensive deployment documentation covering both automated and manual deployment methods.

  • Adds GitHub Actions workflow for automated PyPI publishing on releases and manual triggers
  • Creates comprehensive deployment documentation with step-by-step guides
  • Implements proper build validation and mutually exclusive publishing steps

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/publish.yml GitHub Actions workflow for automated PyPI publishing with release triggers and manual dispatch options
DEPLOYMENT.md Comprehensive deployment guide covering automated GitHub Actions and manual deployment methods

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +42 to +43
test -f dist/*.whl || exit 1
test -f dist/*.tar.gz || exit 1
Copy link

Copilot AI Sep 23, 2025

Choose a reason for hiding this comment

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

Using shell globbing with test -f may fail if multiple files match the pattern. Use ls dist/*.whl | wc -l or find commands to ensure at least one file exists of each type."

Suggested change
test -f dist/*.whl || exit 1
test -f dist/*.tar.gz || exit 1
find dist -maxdepth 1 -name '*.whl' -type f | grep -q . || exit 1
find dist -maxdepth 1 -name '*.tar.gz' -type f | grep -q . || exit 1

Copilot uses AI. Check for mistakes.
```bash
twine upload --repository testpypi dist/*
# Or use a specific profile from .pypirc:
twine upload --config-file .pypirc -r testdsv dist/*
Copy link

Copilot AI Sep 23, 2025

Choose a reason for hiding this comment

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

The repository reference testdsv doesn't match any repository defined in the .pypirc example above. This should be testpypi to match the configuration section name."

Suggested change
twine upload --config-file .pypirc -r testdsv dist/*
twine upload --config-file .pypirc -r testpypi dist/*

Copilot uses AI. Check for mistakes.
@CJHwong CJHwong merged commit dfd2053 into develop Sep 26, 2025
2 checks passed
@CJHwong CJHwong deleted the feat/pypi-publishing-workflow branch September 26, 2025 09:58
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.

3 participants