Skip to content

Latest commit

 

History

History
46 lines (37 loc) · 1.73 KB

File metadata and controls

46 lines (37 loc) · 1.73 KB

Publishing distlink-python

The repository contains separate workflows for validation, TestPyPI, and the production PyPI index. Long-lived PyPI tokens are not required.

One-time setup

  1. Create the public GitHub repository troyrock/distlink-python and push the main branch.
  2. On TestPyPI, create a pending Trusted Publisher with:
    • owner: troyrock
    • repository: distlink-python
    • workflow: test-publish.yml
    • environment: testpypi
  3. On PyPI, create a pending Trusted Publisher with:
    • owner: troyrock
    • repository: distlink-python
    • workflow: release.yml
    • environment: pypi
  4. Create matching testpypi and pypi GitHub environments. Configure required reviewers for the production pypi environment if desired.

The distlink-python distribution name was reserved by the first successful PyPI upload of version 0.2.0.

TestPyPI release

  1. Confirm that the CI workflow passes on main.

  2. Run the Publish to TestPyPI workflow manually.

  3. Install the uploaded version in a clean environment and run a smoke test:

    python -m pip install --index-url https://test.pypi.org/simple/ --no-deps distlink-python
    python -c "from distlink import COrbitData; print(COrbitData())"
    

Production release

  1. Update the version in pyproject.toml and add its release notes to CHANGELOG.md. PyPI does not permit replacing an uploaded distribution file with different content.
  2. Confirm that CI and the TestPyPI installation pass.
  3. Create and publish a GitHub release whose tag matches the version, for example v0.2.0.
  4. Approve the pypi environment deployment if an approval rule is enabled. Publishing the GitHub release triggers .github/workflows/release.yml.