Repository navigation
ci(release): add an environment and provenance to the publish job - #739
omkargaikwad23 wants to merge 6 commits into
Conversation
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.
|
/gcbrun |
| merge-multiple: true | ||
|
|
||
| # To verify a download: | ||
| # gh attestation verify FILE --repo GoogleCloudPlatform/evalbench |
There was a problem hiding this comment.
--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.ZThere was a problem hiding this comment.
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.
| results | ||
| .jetskicli | ||
|
|
||
| **/.env |
There was a problem hiding this comment.
nit: **/.env* would also cover .env.local and similar.
There was a problem hiding this comment.
Done. It is now **/.env*. I kept .env.example with a ! rule, because the repo has one template file with that name.
…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.
|
/gcbrun |
|
/gcbrun |
What
publish-releaseuses the environmentrelease. The environment has no protection rules until a maintainer adds them in the repository settings.publish-releasecreates a provenance attestation for the release archives before the upload.README.mdand the workflow file show the command to verify a download..dockerignorelists**/.env*anddist. It keeps.env.example, which is a template with no secret values.Why
mainand the release tags.COPY . .. Without the new.dockerignoreentries, a local image build copies.envfiles anddistinto the image.Testing
publish-releasejob differs frommain. In this PR, the workflow builds and smoke-tests the binary on the three platforms..dockerignoreofmainand of this PR:main.env,sub/.env,.env.local,sub/.env.production,.envrcdist/.env.examplegh2.97.0 on a public attestation of a different repository: a wrong--signer-workflowfails the check, and a wrong--source-reffails the check.Logs (Google-internal): https://paste.googleplex.com/6755399437647191