Skip to content

ci(release): add an environment and provenance to the publish job - #739

Open
omkargaikwad23 wants to merge 6 commits into
mainfrom
fix/release-publish-gate
Open

omkargaikwad23 wants to merge 6 commits into
mainfrom
fix/release-publish-gate

Conversation

@omkargaikwad23

@omkargaikwad23 omkargaikwad23 commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

What

  • publish-release uses the environment release. The environment has no protection rules until a maintainer adds them in the repository settings.
  • publish-release creates a provenance attestation for the release archives before the upload. README.md and the workflow file show the command to verify a download.
  • The publish condition moved from the upload step to the job. A manual run with no tag now skips the job.
  • .dockerignore lists **/.env* and dist. It keeps .env.example, which is a template with no secret values.

Why

  • A manual run of the release workflow with a tag can replace the files of a published release, from each branch. This path has no review. With rules on the environment, a maintainer can limit the publish job to main and the release tags.
  • The release archives had no provenance, so a user could not verify a download.
  • The Dockerfile has COPY . .. Without the new .dockerignore entries, a local image build copies .env files and dist into the image.

Testing

  • The workflow file is valid YAML, and only the publish-release job differs from main. In this PR, the workflow builds and smoke-tests the binary on the three platforms.
  • The attestation step and the upload run only for a release, so they did not run here. The first release is their first test.
  • A test image build with the .dockerignore of main and of this PR:
File in the build context main This PR
.env, sub/.env, .env.local, sub/.env.production, .envrc In the image Not in the image
dist/ In the image Not in the image
.env.example In the image In the image
  • The verify flags, with gh 2.97.0 on a public attestation of a different repository: a wrong --signer-workflow fails the check, and a wrong --source-ref fails the check.
  • No eval run. The PR changes no Python code.

Logs (Google-internal): https://paste.googleplex.com/6755399437647191

The publish-release job can write release files, and no approval gate
protects it. The release archives have no provenance.

The job now uses the environment "release". The protection rules of an
environment are a repository setting. The job also creates a provenance
attestation for the archives before the upload.

The publish condition moved from the upload step to the job, so a manual
run with no tag skips the job.

.dockerignore now lists **/.env and dist. The Dockerfile copies the whole
build context, so a local build copied these files into the image.
@omkargaikwad23
omkargaikwad23 marked this pull request as ready for review November 26, 2026 07:04
@prernakakkar-google

Copy link
Copy Markdown
Collaborator

/gcbrun

Comment thread .github/workflows/release.yml Outdated
merge-multiple: true

# To verify a download:
# gh attestation verify FILE --repo GoogleCloudPlatform/evalbench

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

--repo alone accepts an attestation signed by any workflow in this repo, and a workflow on any branch can ask for attestations: write. Lets document the stricter form here and in the README:

gh attestation verify FILE --repo GoogleCloudPlatform/evalbench \
  --signer-workflow GoogleCloudPlatform/evalbench/.github/workflows/release.yml \
  --source-ref refs/tags/vX.Y.Z

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good point, done. The workflow comment and the README now show the command with --signer-workflow and --source-ref. One note: --source-ref is the ref of the run. For a release it is the tag. For a manual re-upload it is the branch of that run, so the comment says to start a manual run from the tag.

Comment thread .dockerignore Outdated
results
.jetskicli

**/.env

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: **/.env* would also cover .env.local and similar.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done. It is now **/.env*. I kept .env.example with a ! rule, because the repo has one template file with that name.

omkargaikwad23 and others added 2 commits December 2, 2026 12:24
…iles

- The verify command now gives the signer workflow and the source ref. With
  --repo only, an attestation from each workflow of the repo passes.
- README.md has the same command.
- .dockerignore lists **/.env* and keeps .env.example.
@omkargaikwad23

Copy link
Copy Markdown
Collaborator Author

/gcbrun

@omkargaikwad23

Copy link
Copy Markdown
Collaborator Author

/gcbrun

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