Skip to content

Add tagged PyPI release publishing#96

Closed
FindHao wants to merge 1 commit intomainfrom
findhao/stable_pypi
Closed

Add tagged PyPI release publishing#96
FindHao wants to merge 1 commit intomainfrom
findhao/stable_pypi

Conversation

@FindHao
Copy link
Copy Markdown
Member

@FindHao FindHao commented Sep 10, 2025

Summary

  • Enable publishing stable releases to PyPI when pushing version tags.

Changes

  • .github/workflows/nightly-pypi.yml
    • Add push triggers for version tags: v* and *.*.*.
    • Skip nightly version computation on tag events: if: github.ref_type != 'tag'.
    • Build step sets SETUPTOOLS_SCM_PRETEND_VERSION only for non-tag events; tagged builds derive version from the tag via setuptools-scm.
    • Publish step runs on schedule (nightly) or when ref_type == 'tag' (stable release).

Behavior

  • Tag push (e.g., v0.2.0): produces a stable artifact with version 0.2.0 and publishes to PyPI.
  • Nightly behavior is unchanged and continues to publish dev builds on schedule.

How to verify

  • Ensure PYPI_API_TOKEN is configured in repository secrets.
  • Create and push a tag: git tag v0.2.0 && git push origin v0.2.0.
  • Check workflow logs:
    • The nightly version computation step is skipped.
    • Built artifacts in dist/ use the tag version (no dev).
    • Publish step executes for the tag event.

Safety

  • To avoid unintended publishing during tests, omit PYPI_API_TOKEN or test on a fork/private repo.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 10, 2025
@FindHao FindHao force-pushed the findhao/stable_pypi branch 2 times, most recently from a563c34 to c20631c Compare September 10, 2025 20:30
Summary:
This commit updates the nightly PyPI publish workflow to include additional triggers for publishing. It now allows publishing on tag pushes, specifically for versioned tags (e.g., "v*" and "*.*.*"), in addition to the existing scheduled runs.

Changes:
- Added `push` triggers for versioned tags in `.github/workflows/nightly-pypi.yml`.
- Modified conditions for building and publishing to accommodate tag events.

This enhancement improves the flexibility of the publishing process, enabling immediate releases upon tagging.
@FindHao FindHao force-pushed the findhao/stable_pypi branch from c20631c to 0d93246 Compare September 10, 2025 22:45
@FindHao FindHao marked this pull request as ready for review September 10, 2025 22:54
@facebook-github-bot
Copy link
Copy Markdown
Contributor

@FindHao has imported this pull request. If you are a Meta employee, you can view this in D82163764.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@FindHao merged this pull request in e6f0b85.

@FindHao FindHao deleted the findhao/stable_pypi branch September 19, 2025 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants