Skip to content

Use official action to publish package in CI - #1169

Open
EpicWink wants to merge 4 commits into
opencv:4.xfrom
EpicWink:official-publish-action
Open

EpicWink wants to merge 4 commits into
opencv:4.xfrom
EpicWink:official-publish-action

Conversation

@EpicWink

@EpicWink EpicWink commented Dec 19, 2025 •

Copy link
Copy Markdown

This enables trusted publishing (with attestations).

Tasks a maintainer needs to do:

  • Create GitHub environments: test-opencv-python-release (for test-PyPI), opencv-python-rolling-release, and opencv-python-release
  • Configure trusted publishers in PyPI: see below table (48 total)
  • (Optional) remove the GitHub project secrets: OPENCV_PYTHON_ROLLING_PASSWORD, OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD, OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD, OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD, PYPI_PASSWORD (test-PyPI), OPENCV_PYTHON_PASSWORD, OPENCV_CONTRIB_PYTHON_PASSWORD, OPENCV_PYTHON_HEADLESS_PASSWORD, OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD
  • (Optional) once this pull request is accepted, make a pre-release to test the configuration
Environment PyPI For each package For each GitHub Actions workflow
test-opencv-python-release Test
  • opencv-python
  • opencv-contrib-python
  • opencv-python-headless
  • opencv-contrib-python-headless
  • build_wheels_macos.yml
  • build_wheels_macos_m1.yml
  • build_wheels_manylinux.yml
  • build_wheels_windows.yml
opencv-python-release Real
  • opencv-python
  • opencv-contrib-python
  • opencv-python-headless
  • opencv-contrib-python-headless
  • build_wheels_macos.yml
  • build_wheels_macos_m1.yml
  • build_wheels_manylinux.yml
  • build_wheels_windows.yml
opencv-python-rolling-release Real
  • opencv-python-rolling
  • opencv-contrib-python-rolling
  • opencv-python-headless-rolling
  • opencv-contrib-python-headless-rolling
  • build_wheels_macos.yml
  • build_wheels_macos_m1.yml
  • build_wheels_manylinux.yml
  • build_wheels_windows.yml

Resolves #1110

This enables trusted publishing (with attestations).
@asmorkalov asmorkalov self-assigned this Jan 1, 2026
@asmorkalov
asmorkalov self-requested a review January 1, 2026 09:53
@EpicWink

EpicWink commented Jan 2, 2026

Copy link
Copy Markdown
Author

Failing tests seem unrelated (due to misusing NumPy single-value arrays as scalars)

@EpicWink

EpicWink commented Aug 24, 2026 •

Copy link
Copy Markdown
Author

@Mukller

Consider consolidating publishing into a single dedicated workflow (a publish job that downloads the wheel artifacts from the four build workflows via needs:/artifacts). That reduces the trusted-publisher configuration to one workflow filename per project and removes four copies of the near-identical upload boilerplate.

Having the publish be a separate workflow (from building) makes auditing harder, complicating the chain of provenance.

I suggest combining the workflows into one file. This is sensible as they all do effectively the same thing (build, test, pre-release, release rolling, release), only in different environments. I've done this in #1265

This branch has not been deployed

No deployments
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.

Switch to trusted publishing for package upload to PyPI in CI

2 participants