Skip to content

ci: migrate PyPI publishing workflow to OSS Exit Gate - #1358

Open
alonsopf89 wants to merge 2 commits into
google:masterfrom
alonsopf89:oss-exit-gate-pypi-migration
Open

alonsopf89 wants to merge 2 commits into
google:masterfrom
alonsopf89:oss-exit-gate-pypi-migration

Conversation

@alonsopf89

Copy link
Copy Markdown

Summary

Migrates PyPI package publishing (openhtf) in .github/workflows/python_publish.yml to Google's OSS Exit Gate (openhtf/pypi) using keyless Workload Identity Federation (OIDC):

  • Authenticates to Google Cloud via google-github-actions/auth (workload_identity_provider: 'projects/305452601764/locations/global/workloadIdentityPools/builders/providers/github') and google-github-actions/setup-gcloud.
  • Cleans up any incomplete staged version (openhtf@${PKG_VER}) in the staging Artifact Registry repository (openhtf--pypi) prior to uploading.
  • Stages built distributions to Artifact Registry (https://us-python.pkg.dev/oss-exit-gate-prod/openhtf--pypi/) and uploads manifest.json (PublishingManifest) to gs://oss-exit-gate-prod-projects-bucket/openhtf/pypi/manifests/ to trigger downstream PyPI release.
  • End-to-end staging & manifest smoke test verified against oss-exit-gate-prod (openhtf--pypi).

Internal Reference (for Google maintainers):

  • Author: Fernando Alonso (http://who/fernandoalonso — @alonsopf89, registered in https://opensource.corp.google.com/github/, working with the Google Open Source Security / ISE OSS Exit Gate team)
  • Documentation & Migration Guide: http://go/oss-exit-gate (internal to google3)
  • Buganizer Tracking Issue: http://b/579645744 (Parent Epic: http://b/576673325)
  • OSS Exit Gate Onboarding Config: //depot/google3/configs/security/opensource/exit_gate/prod/projects/openhtf/pypi/project.txtpb
    • Step 6 Config CL: http://cl/1017641577
    • Step 7 Provisioned Resources CL (README.md): http://cl/1017672362
    • Trusted Publisher SA (for PyPI Trusted Publishing setup): openhtf-py@oss-exit-gate-prod.iam.gserviceaccount.com
    • Once this PR is merged, we will send the final internal Step 10 Critique CL transferring maintainers and email_notifications in project.txtpb directly to your team.

@glados-verma

Copy link
Copy Markdown
Collaborator

It seems the zizmor/unpinned-uses errors will have to be fixed before this can be merged?

@glados-verma

Copy link
Copy Markdown
Collaborator

Also, can you try turning the PKG_VER= one-line Python script into a more readable multiline?

@alonsopf89

Copy link
Copy Markdown
Author

Thanks for the review @glados-verma! Pinned all GitHub Actions in .github/workflows/python_publish.yml to commit SHAs (with explicit permissions: contents: read) so zizmor passes, and refactored the PKG_VER extraction into a readable multiline Python block. All checks are green now!

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.

2 participants