Skip to content

Commit 2be2c25

Browse files
authored
docs: Update RELEASE.md (#2521)
Updates RELEASE.md to: - Add a command to update ref for maven actions for RC releases - Add commands for updating the ref for `generate-builder` during adversarial verifier tests --------- Signed-off-by: Ian Lewis <[email protected]>
1 parent ea62fe8 commit 2be2c25

File tree

1 file changed

+61
-18
lines changed

1 file changed

+61
-18
lines changed

RELEASE.md

Lines changed: 61 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,15 @@ This will trigger the [release workflow](https://github.com/slsa-framework/slsa-
102102
Update version references with the following command:
103103

104104
```shell
105-
find .github/workflows/ .github/actions/ actions/ -name '*.yaml' -o -name '*.yml' | xargs sed -i "s/uses: slsa-framework\/slsa-github-generator\/\(.*\)@\(main\|v[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc\.[0-9]\+\)\?\)/uses: slsa-framework\/slsa-github-generator\/\1@$BUILDER_TAG/"
105+
find .github/workflows/ .github/actions/ actions/ -name '*.yaml' -o -name '*.yml' -type f | xargs sed -i "s/uses: slsa-framework\/slsa-github-generator\/\(.*\)@\(main\|v[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc\.[0-9]\+\)\?\)/uses: slsa-framework\/slsa-github-generator\/\1@$BUILDER_TAG/"
106+
find actions/maven/ internal/builders/maven/ -name '*.yaml' -o -name '*.yml' -type f | xargs sed -i "s/\(ref:[ ]*\)\(main\|v[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc\.[0-9]\+\)\?\)/\1$BUILDER_TAG/"
106107
```
107108

108-
Send a PR with this update and add `#label:release ${BUILDER_TAG}` in the PR description.
109+
Send a PR with this update and add the following to the PR description.
110+
111+
```text
112+
#label:release ${BUILDER_TAG}
113+
```
109114

110115
Once the PR is merged, immediately update the tag to point to HEAD.
111116

@@ -136,49 +141,84 @@ There is one integration test we cannot easily test "live", so we need to simula
136141
```
137142

138143
2. Ensure your fork of the builder is at the same commit hash as the official builder's `$BUILDER_TAG` release.
139-
3. Create a new branch `git checkout -b "$BUILDER_REF"`
140-
4. Update the file `$BUILDER_REPOSITORY/main/.github/actions/generate-builder/action.yml` by replacing the strings `BUILDER_REPOSITORY` and `VERIFIER_REPOSITORY` with your own username (value of `$GITHUB_USERNAME`). Then push the changes.
141-
5. For the Go builder, update the file `$BUILDER_REPOSITORY/main/.github/workflows/builder_go_slsa3.yml` to:
144+
3. Create a new branch
145+
146+
```shell
147+
git checkout -b "$BUILDER_REF"
148+
```
149+
150+
4. Update the file `.github/actions/generate-builder/action.yml` by replacing the strings `BUILDER_REPOSITORY` and `VERIFIER_REPOSITORY` with your own username (value of `$GITHUB_USERNAME`). Then push the changes.
151+
152+
```shell
153+
sed -i "s/BUILDER_REPOSITORY: slsa-framework\/slsa-github-generator/BUILDER_REPOSITORY: ${GITHUB_USERNAME}\/slsa-github-generator/" .github/actions/generate-builder/action.yml
154+
sed -i "s/VERIFIER_REPOSITORY: slsa-framework\/slsa-verifier/VERIFIER_REPOSITORY: ${GITHUB_USERNAME}\/slsa-verifier/" .github/actions/generate-builder/action.yml
155+
```
156+
157+
5. For the Go builder, update the file `.github/workflows/builder_go_slsa3.yml` to:
142158

143159
```yaml
144160
uses: $BUILDER_REPOSITORY/.github/actions/generate-builder@$BUILDER_TAG
145161
```
146162
163+
using this command:
164+
165+
```shell
166+
sed -i "s/uses: slsa-framework\/slsa-github-generator\/\.github\/actions\/generate-builder@\(main\|v[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc\.[0-9]\+\)\?\)/uses: ${BUILDER_REPOSITORY/\//\\\/}\/.github\/actions\/generate-builder@${BUILDER_TAG}/" .github/workflows/builder_go_slsa3.yml
167+
```
168+
147169
Add `testing: true` as an input.
148170

149-
6. For the Generic generator, update the file `$BUILDER_REPOSITORY/main/.github/workflows/generator_generic_slsa3.yml`to:
171+
6. For the Generic generator, update the file `.github/workflows/generator_generic_slsa3.yml` to:
150172

151173
```yaml
152174
uses: $BUILDER_REPOSITORY/.github/actions/generate-builder@$BUILDER_TAG
153175
```
154176

177+
using this command:
178+
179+
```shell
180+
sed -i "s/uses: slsa-framework\/slsa-github-generator\/\.github\/actions\/generate-builder@\(main\|v[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc\.[0-9]\+\)\?\)/uses: ${BUILDER_REPOSITORY/\//\\\/}\/.github\/actions\/generate-builder@${BUILDER_TAG}/" .github/workflows/generator_generic_slsa3.yml
181+
```
182+
155183
Add `testing: true` as an input.
156184

157-
7. For the Container generator, update the file `$BUILDER_REPOSITORY/main/.github/workflows/generator_container_slsa3.yml`to:
185+
7. For the Container generator, update the file `.github/workflows/generator_container_slsa3.yml` to:
158186

159187
```yaml
160188
uses: $BUILDER_REPOSITORY/.github/actions/generate-builder@$BUILDER_TAG
161189
```
162190

191+
using this command:
192+
193+
```shell
194+
sed -i "s/uses: slsa-framework\/slsa-github-generator\/\.github\/actions\/generate-builder@\(main\|v[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc\.[0-9]\+\)\?\)/uses: ${BUILDER_REPOSITORY/\//\\\/}\/.github\/actions\/generate-builder@${BUILDER_TAG}/" .github/workflows/generator_container_slsa3.yml
195+
```
196+
163197
Add `testing: true` as an input.
164198

165-
8. For the Container-based generator, update the file `$BUILDER_REPOSITORY/main/.github/workflows/builder_container-based_slsa3.yml`to:
199+
8. For the Container-based generator, update the file `.github/workflows/builder_container-based_slsa3.yml` to:
166200

167201
```yaml
168202
uses: $BUILDER_REPOSITORY/.github/actions/generate-builder@$BUILDER_TAG
169203
```
170204

205+
using this command:
206+
207+
```shell
208+
sed -i "s/uses: slsa-framework\/slsa-github-generator\/\.github\/actions\/generate-builder@\(main\|v[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc\.[0-9]\+\)\?\)/uses: ${BUILDER_REPOSITORY/\//\\\/}\/.github\/actions\/generate-builder@${BUILDER_TAG}/" .github/workflows/builder_container-based_slsa3.yml
209+
```
210+
171211
Add `testing: true` as an input.
172212

173213
9. Commit and push the changes
174214

175215
10. Create a release for the builders for this branch:
176216

177-
```shell
178-
"$GH" release -R "$BUILDER_REPOSITORY" create "$BUILDER_TAG" --title "$BUILDER_TAG" --notes "pre-release tests for $BUILDER_TAG $(date)" --target "$BUILDER_REF"
179-
```
217+
```shell
218+
"$GH" release -R "$BUILDER_REPOSITORY" create "$BUILDER_TAG" --title "$BUILDER_TAG" --notes "pre-release tests for $BUILDER_TAG $(date)" --target "$BUILDER_REF"
219+
```
180220

181-
This will trigger a workflow release, let it complete and generate the release assets.
221+
This will trigger a workflow release, let it complete and generate the release assets.
182222

183223
#### Go builder verifier test
184224

@@ -474,17 +514,21 @@ This will trigger the [release workflow](https://github.com/slsa-framework/slsa-
474514
Update version references with the following command:
475515

476516
```shell
477-
find .github/workflows/ .github/actions/ actions/ -name '*.yaml' -o -name '*.yml' | xargs sed -i "s/uses: slsa-framework\/slsa-github-generator\/\(.*\)@\(main\|v[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc\.[0-9]\+\)\?\)/uses: slsa-framework\/slsa-github-generator\/\1@$BUILDER_TAG/"
478-
find actions/maven/ internal/builders/maven/ -name '*.yaml' -o -name '*.yml' -type f | xargs sed -i "s/\(ref:[ ]*\)main/\1$BUILDER_TAG/"
517+
find .github/workflows/ .github/actions/ actions/ -name '*.yaml' -o -name '*.yml' -type f | xargs sed -i "s/uses: slsa-framework\/slsa-github-generator\/\(.*\)@\(main\|v[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc\.[0-9]\+\)\?\)/uses: slsa-framework\/slsa-github-generator\/\1@$BUILDER_TAG/"
518+
find actions/maven/ internal/builders/maven/ -name '*.yaml' -o -name '*.yml' -type f | xargs sed -i "s/\(ref:[ ]*\)\(main\|v[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc\.[0-9]\+\)\?\)/\1$BUILDER_TAG/"
479519
```
480520

481521
Likewise, update documentation with the following command:
482522

483523
```shell
484-
find . -name "*.md" -exec sed -i "s~\(uses: .*/slsa-github-generator/.*@\)v[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc\.[0-9]\+\)\?~\1$BUILDER_TAG~g" {} +
524+
find . -name "*.md" -type f -exec sed -i "s~\(uses: .*/slsa-github-generator/.*@\)v[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc\.[0-9]\+\)\?~\1$BUILDER_TAG~g" {} +
485525
```
486526

487-
Send a PR with this update and add `#label:release ${BUILDER_TAG}` in the PR description.
527+
Send a PR with this update and add the following to the PR description.
528+
529+
```text
530+
#label:release ${BUILDER_TAG}
531+
```
488532

489533
Once the PR is merged, immediately update the tag to point to HEAD.
490534

@@ -504,9 +548,8 @@ Re-run the [adversarial builder tests](#adversarial-builder-tests) using the fin
504548
Send a PR to reference the Actions at `@main`. You can use:
505549

506550
```shell
507-
find .github/workflows/ .github/actions/ actions/ -name '*.yaml' -o -name '*.yml' | xargs sed -i "s/uses: slsa-framework\/slsa-github-generator\/\(.*\)@${BUILDER_TAG}/uses: slsa-framework\/slsa-github-generator\/\1@main/"
551+
find .github/workflows/ .github/actions/ actions/ -name '*.yaml' -o -name '*.yml' -type f | xargs sed -i "s/uses: slsa-framework\/slsa-github-generator\/\(.*\)@${BUILDER_TAG}/uses: slsa-framework\/slsa-github-generator\/\1@main/"
508552
find actions/maven/ internal/builders/maven/ -name '*.yaml' -o -name '*.yml' -type f | xargs sed -i "s/\(ref:[ ]*\)$BUILDER_TAG/\1main/"
509-
510553
```
511554

512555
### Update verifier

0 commit comments

Comments
 (0)