Skip to content

[ci] simplify release workflow.#13329

Open
sayakpaul wants to merge 2 commits intomainfrom
overhaul-release-workflow
Open

[ci] simplify release workflow.#13329
sayakpaul wants to merge 2 commits intomainfrom
overhaul-release-workflow

Conversation

@sayakpaul
Copy link
Member

What does this PR do?

Simplify release workflow like https://github.com/huggingface/transformers/blob/main/.github/workflows/release.yml.

  • Removed Test PyPI — no longer publish to Test PyPI and install from there; instead, install directly from the locally built wheel to validate.
  • Two-job structure: build-and-test (find release branch, build, install from wheel, run import tests) -> publish-to-pypi (download artifacts, publish).
  • Manual approval gate via GitHub Environment pypi-release with required reviewers — publishing pauses until a maintainer approves.
  • OIDC trusted publishing using pypa/gh-action-pypi-publish — replaces Twine username/password secrets.
  • Fixed deprecated ::set-output — no longer needed since branch resolution happens in the same job.

I have taken care of the following config setups to make it work:

  • Create a GitHub Environment called pypi-release with required reviewers (Dhruv, Yiyi, and myself).
  • Configure PyPI trusted publishing for the huggingface/diffusers repo, specifying the pypi-release environment.

@sayakpaul sayakpaul requested a review from DN6 March 25, 2026 04:04
pip install -U torch --index-url https://download.pytorch.org/whl/cpu
- name: Build the dist files
run: python setup.py bdist_wheel && python setup.py sdist
Copy link
Collaborator

Choose a reason for hiding this comment

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

Small nit. Running commands like this with setup.py is deprecated in favour of just running a single
python -m build which gives you both the sdist and the wheel
https://setuptools.pypa.io/en/latest/deprecated/commands.html#running-setuptools-commands

Think we can just use that here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh nice one. Updated.

@sayakpaul sayakpaul requested a review from DN6 March 25, 2026 05:10
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