Skip to content

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

Merged
copybara-service[bot] merged 2 commits into
google-deepmind:mainfrom
alonsopf89:oss-exit-gate-pypi-migration
Nov 18, 2026
Merged

copybara-service[bot] merged 2 commits into
google-deepmind:mainfrom
alonsopf89:oss-exit-gate-pypi-migration

Conversation

@alonsopf89

Copy link
Copy Markdown
Contributor

Summary

Migrates PyPI package publishing (android-env) in .github/workflows/release.yml to Google's OSS Exit Gate (android-env/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 (android-env@${PKG_VER}) in the staging Artifact Registry repository (android-env--pypi) prior to uploading.
  • Stages built distributions to Artifact Registry (https://us-python.pkg.dev/oss-exit-gate-prod/android-env--pypi/) and uploads manifest.json (PublishingManifest) to gs://oss-exit-gate-prod-projects-bucket/android-env/pypi/manifests/ to trigger downstream PyPI release.
  • End-to-end staging & manifest smoke test verified against oss-exit-gate-prod (android-env--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/579427477 (Parent Epic: http://b/576673325)
  • OSS Exit Gate Onboarding Config: //depot/google3/configs/security/opensource/exit_gate/prod/projects/android-env/pypi/project.txtpb
    • Step 6 Config CL: http://cl/1018113140
    • Step 7 Provisioned Resources CL (README.md): http://cl/1018137424
    • Trusted Publisher SA (for PyPI Trusted Publishing setup): android-env-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.

@alonsopf89

Copy link
Copy Markdown
Contributor Author

Thanks @kenjitoyama for the thorough review on Copybara cl/1023765663! I just pushed an update addressing the artifact path catch and answering all three questions:

  1. Step 10 handoff & notifications before v2.0.0: Yes — right after this PR/CL lands (and before you push tag v2.0.0), I will send and land the Step 10 CL updating android-env/pypi/project.txtpb (and OWNERS) to:
    • maintainers: group:androidenv-team@google.com, user:kenjitoyama@google.com
    • email_notifications: androidenv-team@google.com, kenjitoyama@google.com
    • buganizer_component_id: 570112 and mdb_group: "deepmind-android-env"
    • Removing disable_bypass_alert_notifications and temporary onboarding entries so your team receives automatic start/completion/failure emails on v2.0.0.
  2. PyPI Trusted Publisher & Secret Manager unlock status:
    • Trusted Publisher (required before v2.0.0): android-env/pypi publishes via keyless Google Cloud OIDC (publishing.method: PIPELINE), so a deepmind PyPI admin needs to register android-env-py@oss-exit-gate-prod.iam.gserviceaccount.com as a Google Cloud Trusted Publisher on pypi.org/manage/project/android-env/settings/publishing/.
    • Secret Manager (deepmind user account secrets): android-env--pypi--user--{password,mfa_setup_key,mfa_recovery_keys} currently have 0 versions populated in oss-exit-gate-prod — to fully unlock the project in OSS Exit Gate, either populate those via grants add android-env-py-oss-eg-cred-access:2h after Step 10 OR let me know which existing onboarded DeepMind PyPI project already stores the deepmind user credentials and I can point registry_user_account.credentials.copy_from to it in the Step 10 CL!
  3. Artifact path fix (release.yml): Updated actions/upload-artifact to path: bazel-bin/android_env/*.whl (if-no-files-found: error) AND updated exit_gate_cleanup + twine upload to use recursive dist/**/*.whl / dist/**/*.tar.gz globs (plus readable multiline Python) so neither flat nor nested paths can fail.

@copybara-service
copybara-service Bot merged commit 55aeb19 into google-deepmind:main Nov 18, 2026
8 checks passed
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.

1 participant