Skip to content

Add PyPI publishing workflow (Trusted Publishing / OIDC)#4480

Open
LiliDeng wants to merge 2 commits into
mainfrom
feature/pip-install-lisa_130526_105955
Open

Add PyPI publishing workflow (Trusted Publishing / OIDC)#4480
LiliDeng wants to merge 2 commits into
mainfrom
feature/pip-install-lisa_130526_105955

Conversation

@LiliDeng
Copy link
Copy Markdown
Collaborator

What

Add PyPI publishing infrastructure so end users can pip install mslisa[azure].

Changes

  • .github/workflows/publish.yml — tag-triggered (CalVer YYYYMMDD.N).
    Builds sdist + wheel on Linux, runs twine check, publishes to TestPyPI
    first, then PyPI. Both publishes use PyPI Trusted Publishing (OIDC)
    no API tokens stored. Final PyPI push is gated by pypi GitHub
    Environment reviewer approval.
  • RELEASE.md — one-time bootstrap (pending publishers, GitHub
    environments, tag protection) plus per-release SOP and known limitations.
  • MANIFEST.inprune lisa/ai/data (deeply-nested log paths trip
    the Windows 260-char limit during local python -m build; Linux CI is
    unaffected).

Bootstrap status

  • PyPI pending publisher for mslisa (env pypi)
  • TestPyPI pending publisher for mslisa (env testpypi)
  • Needs admin: create GitHub Environments pypi (with reviewers)
    and testpypi in repo Settings → Environments
  • (optional) Tag protection rule 2[0-9][0-9][0-9][0-9][0-9][0-9][0-9].*

Verification

Smoketested end-to-end on a fork using a temporary package name
mslisa-lildeng-test:

  • build, twine check, OIDC, TestPyPI publish, PyPI publish — all green
  • Installed the published wheel in a clean venv → lisa --help works
  • Test project cleaned up afterwards

After merge, plan to push an RC tag (e.g. YYYYMMDD.NrcN) to validate the
full pipeline against microsoft/lisa before the first real release.

How users will install

pip install mslisa              # core only
pip install "mslisa[azure]"     # most common
pip install "mslisa[azure,libvirt]"
lisa --help

LiliDeng added 2 commits May 13, 2026 12:42
- .github/workflows/publish.yml: tag-triggered build then publish via PyPI Trusted Publishing (OIDC); TestPyPI first, then PyPI gated by GitHub Environment reviewer approval. No tokens stored.

- RELEASE.md: one-time bootstrap (pending publishers, GitHub environments, tag protection) plus per-release SOP and known limitations.

- MANIFEST.in: prune lisa/ai/data; deeply nested log paths trigger Windows 260-char limit during sdist build.
Copilot AI review requested due to automatic review settings May 13, 2026 07:12
@LiliDeng LiliDeng requested a review from johnsongeorge-w as a code owner May 13, 2026 07:12
Copy link
Copy Markdown
Contributor

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

Adds a GitHub Actions-based release pipeline for publishing the mslisa package to TestPyPI and PyPI using PyPI Trusted Publishing (OIDC), along with release runbook documentation and an sdist pruning tweak to avoid Windows path-length issues during local builds.

Changes:

  • Introduce a tag-triggered publish.yml workflow that builds artifacts, validates with twine check, publishes to TestPyPI, then publishes to PyPI behind a GitHub Environment approval gate.
  • Add RELEASE.md with bootstrap steps (pending publishers/environments/tag protection) and a per-release SOP.
  • Prune lisa/ai/data from the sdist via MANIFEST.in to reduce deep-path issues on Windows.

Reviewed changes

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

File Description
RELEASE.md Documents bootstrap + release SOP for Trusted Publishing and local dry-run guidance.
MANIFEST.in Excludes lisa/ai/data from sdists to mitigate Windows path-length failures.
.github/workflows/publish.yml Implements the build + TestPyPI + gated PyPI publish workflow using OIDC.

Comment thread RELEASE.md
# Try installing into a fresh venv
py -3.12 -m venv C:\tmp\mslisa-local
$wheel = (Get-Item dist\mslisa-*.whl).FullName
& C:\tmp\mslisa-local\Scripts\python.exe -m pip install "$wheel[azure]"
Comment thread RELEASE.md
Comment on lines +124 to +130
- **sdist build fails on Windows** because `setuptools_scm` includes every git-
tracked file (including deeply nested logs under `lisa/ai/data/...`) and the
resulting paths exceed Windows' 260-character limit. CI builds on Linux are
unaffected. The wheel is what users actually install.
- **`MANIFEST.in` `prune` rules don't apply** to files already tracked by git
when `setuptools_scm` is the file finder. To shrink the sdist, move
`lisa/ai/data/` out of git (git-lfs or a sibling repo).
Comment thread MANIFEST.in
prune .github
exclude .git*

# AI training data is large and not needed at runtime; exclude from sdist/wheel.
Comment on lines +14 to +18
on:
push:
tags:
# CalVer: e.g. 20260420.1, 20260420.2
- "2[0-9][0-9][0-9][0-9][0-9][0-9][0-9].*"
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