8000 ci(release): migrate Maven Central publishing workflow to OSS Exit Gate by alonsopf89 · Pull Request #5367 · google/dagger · GitHub
[go: up one dir, main page]

Skip to content

ci(release): migrate Maven Central publishing workflow to OSS Exit Gate - #5367

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

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

Conversation

@alonsopf89
Copy link
Copy Markdown

Summary

Migrates .github/workflows/release.yml Maven Central publishing to OSS Exit Gate via keyless Workload Identity Federation (OIDC):

  • Keeps GPG artifact signing (gpg:sign-and-deploy-file via CI_GPG_PRIVATE_KEY / CI_GPG_PASSPHRASE), Bazel/Gradle test jobs, and tagged release/docs steps unchanged.
  • Authenticates via google-github-actions/auth (pinned to commit SHA) and deploys all com.google.dagger + com.google.dagger.hilt.android artifacts via util/deploy-all.sh to https://us-maven.pkg.dev/oss-exit-gate-prod/dagger--mavencentral using ephemeral OIDC credentials instead of static CI_DEPLOY_USERNAME / CI_DEPLOY_PASSWORD / SONATYPE_TOKEN secrets.
  • Generates and uploads manifest.json to gs://oss-exit-gate-prod-projects-bucket/dagger/mavencentral/manifests/ to trigger OSS Exit Gate's Maven Central promotion.

workload_identity_provider: 'projects/305452601764/locations/global/workloadIdentityPools/builders/providers/github'
- name: 'Set up Cloud SDK'
uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # v3.0.1
- name: 'Clean up failed staging attempt for this exact version (if any)'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can we move this into a separate bash script?

print(f"Generated manifest.json with {sum(len(v) for v in groups.values())} staged packages across {list(groups.keys())}")
PY
gcloud storage cp manifest.json \
"gs://oss-exit-gate-prod-projects-bucket/dagger/mavencentral/manifests/manifest-${DAGGER_RELEASE_VERSION}-${RUN_ID}-${RUN_ATTEMPT}.json"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can this be pulled out into a separate python script?

run: |
set -euo pipefail
export CI_DEPLOY_USERNAME="oauth2accesstoken"
export CI_DEPLOY_PASSWORD="$(gcloud auth print-access-token)"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Does this need to be masked, e.g. echo "::add-mask::${CI_DEPLOY_PASSWORD}"?

Addresses review feedback from @bcorso:
- Move Artifact Registry staging cleanup loop into util/cleanup-exit-gate-staging.sh.
- Move OSS Exit Gate manifest generator into util/generate-exit-gate-manifest.py.
- Mask CI_DEPLOY_PASSWORD via ::add-mask:: immediately after fetching the
  short-lived gcloud access token.
@alonsopf89
Copy link
Copy Markdown
Author

Thanks for the feedback, @bcorso! Addressed all three comments in 930d515:

  1. Extracted the staging cleanup bash loop into util/cleanup-exit-gate-staging.sh.
  2. Added echo "::add-mask::${CI_DEPLOY_PASSWORD}" right after assigning the short-lived OAuth access token from gcloud auth print-access-token.
  3. Extracted the manifest generation script into util/generate-exit-gate-manifest.py.

Ready for another look whenever you have a chance!

8130

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

0