docs: add instructions on how to complete RC via CLI
galargh committed
Nov 15, 2022 at 13:56 UTC
350f58e5817b31a580acc2336d47f7a74db3e217
1 file changed
+243
-8
docs/RELEASE_ISSUE_TEMPLATE.md
+243
-8
@@ -44,10 +44,47 @@ Checklist:
44
- [ ] Open an issue against [bifrost-infra](https://github.com/protocol/bifrost-infra) ahead of the release ([example](https://github.com/protocol/bifrost-infra/issues/2109)). **Idealy, do this multiple days in advance of the RC** to give Bifrost the heads up that asks will be coming their way.
45
- [ ] Spell out all that we want updated - gateways, the bootstraper and the cluster/preload nodes
46
- [ ] Mention @protocol/bifrost-team in the issue and let them know the expected date of the release
47
- * Issue link:
47
+ - Issue link:
48
+ <details>
49
+ # create new issue in protocol/bifrost-infra
50
+ gh api \
51
+ --method POST \
52
+ --raw-field "title=Rollout Kubo v0.17.0-RC1" \
53
+ --raw-field "body=## What should be updated
54
+
55
+ - [ ] Gateways
56
+ - [ ] Bootstrapper
57
+ - [ ] Cluster/Preload nodes
58
+
59
+ ## When
60
+
61
+ YYYY-MM-DD" \
62
+ repos/protocol/bifrost-infra/issues
63
+ </details>
64
- [ ] Ensure that the `What's left for release` section has all the checkboxes checked. If that's not the case, discuss the open items with Kubo maintainers and update the release schedule accordingly.
49
- - [ ] Create `docs-release-vX.Y.Z` branch, open a draft PR and keep updating `docs/RELEASE_ISSUE_TEMPLATE.md` on that branch as you go ([example](https://github.com/ipfs/kubo/pull/9391)).
50
- - [ ] Link it in the "Meta" section above.
65
+ - [ ] Create `docs-release-vX.Y.Z` branch, open a draft PR and keep updating `docs/RELEASE_ISSUE_TEMPLATE.md` on that branch as you go.
66
+ - [ ] Link it in the "Meta" section above.
67
+ <details>
68
+ # retrieve master ref for ipfs/kubo
69
+ gh api /repos/ipfs/kubo/git/ref/heads/master
70
+
71
+ # create docs-release-v0.17.0 ref for ipfs/kubo
72
+ gh api \
73
+ --method POST \
74
+ /repos/ipfs/kubo/git/refs \
75
+ -f ref='refs/heads/docs-release-v0.17.0' \
76
+ -f sha='254d81a9d5595c3e637c7573d56125836d5f5055'
77
+
78
+ # create draft PR from docs-release-v0.17.0 to master for ipfs/kubo
79
+ # requires docs-release-v0.17.0 to be modified
80
+ gh api \
81
+ --method POST \
82
+ /repos/ipfs/kubo/pulls \
83
+ -f title='docs: release v0.17.0' \
84
+ -f head='docs-release-v0.17.0' \
85
+ -f base='master' \
86
+ -f draft=true
87
+ </details>
88
- [ ] Ensure you have a [GPG key generated](https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key) and [added to your GitHub account](https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-gpg-key-to-your-github-account). This will enable you to created signed tags.
89
- [ ] Ensure you have [admin access](https://discuss.ipfs.tech/g/admins) to [IPFS Discourse](https://discuss.ipfs.tech/). Admin access is required to globally pin posts and create banners. @2color might be able to assist you.
90
- [ ] Access to [#bifrost](https://filecoinproject.slack.com/archives/C03MMMF606T) channel in FIL Slack might come in handy. Ask the release reviewer to invite you over.
@@ -56,49 +93,247 @@ Checklist:
93
- [ ] You're also going to need NPM installed on your system. See [here](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) for instructions.
94
- [ ] Prepare changelog proposal in [docs/changelogs/vX.Y.md](https://github.com/ipfs/kubo/blob/master/docs/changelogs/).
95
- Skip filling out the `### Changelog` section (the one where which lists all the commits and contributors) for now. We will populate it after the release branch is cut.
59
- - PR link:
96
+ - PR link:
97
- [ ] Install ZSH ([instructions](https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH#install-and-set-up-zsh-as-default)). It is needed by the changelog creation script.
98
- [ ] Ensure you have `kubo` checked out under `$(go env GOPATH)/src/github.com/ipfs/kubo`. This is required by the changelog creation script.
99
- If you want your clone to live in a different location, you can symlink it to the expected location by running `mkdir -p $(go env GOPATH)/src/github.com/ipfs && ln -s $(pwd) $(go env GOPATH)/src/github.com/ipfs/kubo`.
100
- [ ] Ensure that [README.md](https://github.com/ipfs/go-ipfs/tree/master/README.md) is up to date.
64
-- [ ] **Stage 1 - Initial Preparations**
101
+- [ ] **Stage 1 - Initial Preparations**
102
- [ ] Upgrade to the latest patch release of Go that CircleCI has published (currently used version: `1.19.1`)
103
- [ ] See the list here: https://hub.docker.com/r/cimg/go/tags
104
+ <details>
105
+ # retrieve the latest version of cimg/go available
106
+ curl -s 'https://hub.docker.com/v2/repositories/cimg/go/tags' | jq -r '.results | map(.name) | map(select(. | test("^[0-9]+\\.[0-9]+\\.[0-9]+$"))) | .[0]'
107
+ </details>
108
- [ ] [ipfs/distributions](https://github.com/ipfs/distributions): bump [this version](https://github.com/ipfs/distributions/blob/master/.tool-versions#L2)
109
+ <details>
110
+ # checkout new branch
111
+ git checkout -b bump-go-version
112
+
113
+ # replace the cimg/go version in .tool-versions in ipfs/distributions
114
+ sed -i 's/golang [0-9]\+\.[0-9]\+\.[0-9]\+/golang 1.19.3/g' .tool-versions
115
+
116
+ # commit the change
117
+ git add .tool-versions
118
+ git commit -m "chore: bump go version to 1.19.3"
119
+
120
+ # push the change
121
+ git push origin bump-go-version
122
+
123
+ # open a PR
124
+ gh api /repos/ipfs/distributions/pulls \
125
+ --method POST \
126
+ -f title='chore: bump go version to 1.19.3' \
127
+ -f head='bump-go-version' \
128
+ -f base='master'
129
+ </details>
130
- [ ] [ipfs/kubo](https://github.com/ipfs/kubo): [example PR](https://github.com/ipfs/kubo/pull/8599)
69
- - [ ] [ipfs/ipfs-docs](https://github.com/ipfs/ipfs-docs): [example PR](https://github.com/ipfs/ipfs-docs/pull/1298)
131
+ <details>
132
+ # checkout new branch
133
+ git checkout -b bump-go-version
134
+
135
+ # replace the cimg/go version in .circleci/main.yml in ipfs/kubo
136
+ sed -i 's/cimg\/go:[0-9]\+\.[0-9]\+\.[0-9]\+/cimg\/go:1.19.3/g' .circleci/main.yml
137
+
138
+ # replace golang version in Dockerfile
139
+ sed -i 's/golang:[0-9]\+\.[0-9]\+\.[0-9]\+/golang:1.19.3/g' Dockerfile
140
+
141
+ # commit the change
142
+ git add .circleci/main.yml Dockerfile
143
+ git commit -m "chore: bump go version to 1.19.3"
144
+
145
+ # push the change
146
+ git push origin bump-go-version
147
+
148
+ # open a PR
149
+ gh api /repos/ipfs/kubo/pulls \
150
+ --method POST \
151
+ -f title='chore: bump go version to 1.19.3' \
152
+ -f head='bump-go-version' \
153
+ -f base='master'
154
+ </details>
155
+ - [ ] [ipfs/ipfs-docs](https://github.com/ipfs/ipfs-docs): [example PR](https://github.com/ipfs/ipfs-docs/pull/1298) - only if the major version changed
156
- [ ] Fork a new branch (`release-vX.Y.Z`) from `master`.
157
+ <details>
158
+ # retrieve master ref for ipfs/kubo
159
+ gh api /repos/ipfs/kubo/git/ref/heads/master
160
+
161
+ # create release-v0.17.0 ref for ipfs/kubo
162
+ gh api \
163
+ --method POST \
164
+ /repos/ipfs/kubo/git/refs \
165
+ -f ref='refs/heads/release-v0.17.0' \
166
+ -f sha='a4da8f6cc768c3e2cce9c2677a792b2c237066aa'
167
+ </details>
168
- [ ] Bump the version in `version.go` in the `master` branch to `vX.(Y+1).0-dev` via a PR ([example](https://github.com/ipfs/kubo/pull/9305)).
169
+ <details>
170
+ # checkout new branch
171
+ git checkout -b bump-version
172
+
173
+ # replace the version in version.go
174
+ sed -i 's/const CurrentVersionNumber = "0.17.0-dev"/const CurrentVersionNumber = "0.18.0-dev"/g' version.go
175
+
176
+ # commit the change
177
+ git add version.go
178
+ git commit -m "chore: bump version to v0.18.0-dev"
179
+
180
+ # push the change
181
+ git push origin bump-version
182
+
183
+ # open a PR
184
+ gh api /repos/ipfs/kubo/pulls \
185
+ --method POST \
186
+ -f title='chore: bump version to v0.18.0-dev' \
187
+ -f head='bump-version' \
188
+ -f base='master'
189
+ </details>
190
- [ ] **Stage 2 - Release Candidate** - _if any [non-trivial](docs/releases.md#footnotes) changes need to be included in the release, return to this stage_
191
- [ ] Bump the version in `version.go` in the `release-vX.Y.Z` branch to `vX.Y.Z-rcN`.
192
+ <details>
193
+ # checkout new branch
194
+ git checkout -b bump-release-version
195
+
196
+ # replace the version in version.go
197
+ sed -i 's/const CurrentVersionNumber = "0.17.0-dev"/const CurrentVersionNumber = "0.17.0-rc1"/g' version.go
198
+
199
+ # commit the change
200
+ git add version.go
201
+ git commit -m "chore: bump version to v0.17.0-rc1"
202
+
203
+ # push the change
204
+ git push origin bump-release-version
205
+
206
+ # open a PR
207
+ gh api /repos/ipfs/kubo/pulls \
208
+ --method POST \
209
+ -f title='chore: bump version to v0.17.0-rc1' \
210
+ -f head='bump-release-version' \
211
+ -f base='release-v0.17.0'
212
+ </details>
213
- [ ] If applicable, add new commits to the `release-vX.Y.Z` branch from `master` using `git cherry-pick -x ...`
214
- Note: `release-*` branches are protected. You can do all needed updates on a separated branch (e.g. `wip-release-vX.Y.Z`) and when everything is settled push to `release-vX.Y.Z`
215
- [ ] Push the `release-vX.Y.Z` branch to GitHub (`git push origin release-vX.Y.Z`) and create a draft PR targetting `release` branch if it doesn't exist yet ([example](https://github.com/ipfs/kubo/pull/9306)).
216
+ <details>
217
+ # open a PR
218
+ gh api /repos/ipfs/kubo/pulls \
219
+ --method POST \
220
+ -f title='wip: release v0.17.0' \
221
+ -f head='release-v0.17.0' \
222
+ -f base='release' \
223
+ -f draft=true
224
+ </details>
225
- [ ] Wait for CI to run and complete PR checks. All checks should pass.
226
- [ ] Create a signed tag for the release candidate.
227
- [ ] This is a dangerous operation, as it is difficult to reverse due to Go modules and automated Docker image publishing. Remember to verify the commands you intend to run for items marked with ⚠️ with the release reviewer.
228
- [ ] ⚠️ Tag HEAD `release-vX.Y.Z` commit with `vX.Y.Z-rcN` (`git tag -s vX.Y.Z-rcN -m 'Pre-release X.Y.Z-rcn'`)
81
- - [ ] Run `git show vX.Y.Z` to ensure the tag is correct.
82
- - [ ] ⚠️ Push the `vX.Y.Z` tag to GitHub (`git push origin vX.Y.Z`; DO NOT USE `git push --tags` because it pushes all your local tags).
229
+ <details>
230
+ # create a signed tag
231
+ git tag -s v0.17.0-rc1 -m 'Pre-release 0.17.0-rc1'
232
+ </details>
233
+ - [ ] Run `git show vX.Y.Z-rc1` to ensure the tag is correct.
234
+ <details>
235
+ # show the signed tag
236
+ git show v0.17.0-rc1
237
+ </details>
238
+ - [ ] ⚠️ Push the `vX.Y.Z-rc1` tag to GitHub (`git push origin vX.Y.Z-rc1`; DO NOT USE `git push --tags` because it pushes all your local tags).
239
+ <details>
240
+ # show the signed tag
241
+ git push origin v0.17.0-rc1
242
+ </details>
243
- [ ] Add artifacts to https://dist.ipfs.tech by making a PR against [ipfs/distributions](https://github.com/ipfs/distributions)
244
- [ ] Clone the `ipfs/distributions` repo locally.
245
- [ ] Create a new branch (`kubo-release-vX.Y.Z-rcn`) from `master`.
246
+ <details>
247
+ # checkout new branch
248
+ git checkout -b kubo-release-v0.17.0-rc1
249
+ </details>
250
- [ ] Run `./dist.sh add-version kubo vX.Y.Z-rcN` to add the new version to the `versions` file ([instructions](https://github.com/ipfs/distributions#usage)).
251
- `dist.sh` will print _WARNING: not marking pre-release kubo vX.Y.Z-rc1n as the current version._.
252
+ <details>
253
+ # add new kubo version to dist
254
+ ./dist.sh add-version kubo v0.17.0-rc1
255
+ </details>
256
- [ ] Push the `kubo-release-vX.Y.Z-rcn` branch to GitHub and create a PR from that branch ([example](https://github.com/ipfs/distributions/pull/760)).
257
+ <details>
258
+ # push the change
259
+ git push origin kubo-release-v0.17.0-rc1
260
+
261
+ # open a PR
262
+ gh api /repos/ipfs/distributions/pulls \
263
+ --method POST \
264
+ -f title='chore: add kubo v0.17.0-rc1' \
265
+ -f head='kubo-release-v0.17.0-rc1' \
266
+ -f base='master'
267
+ </details>
268
- [ ] Ask for a review from the release reviewer.
269
- [ ] Enable auto-merge for the PR.
270
- PR build will build the artifacts and generate a diff in around 30 minutes
271
- PR will be merged automatically once the diff is approved
272
- `master` build will publish the artifacts to https://dist.ipfs.io in around 30 minutes
273
+ <details>
274
+ # get pull id
275
+ id=$(gh api --method GET /repos/ipfs/distributions/pulls -f head='kubo-release-v0.17.0-rc1' --jq '.[0].id')
276
+
277
+ # enable automerge
278
+ gh api graphql -f pull="${id}" -f query='mutation($pull: ID!) { enablePullRequestAutoMerge(input: {pullRequestId: $pull, mergeMethod: SQUASH}) {} }'
279
+ </details>
280
- [ ] Ensure that the artifacts are available at https://dist.ipfs.io
281
+ <details>
282
+ # check if RC is available
283
+ curl --retry 5 --no-progress-meter https://dist.ipfs.tech/kubo/versions | grep -q v0.17.0-rc1
284
+ echo $?
285
+ </details>
286
- [ ] Publish the RC to [the NPM package](https://www.npmjs.com/package/go-ipfs?activeTab=versions) by running https://github.com/ipfs/npm-go-ipfs/actions/workflows/main.yml (it happens automatically but it is safe to speed up the process and kick of a run manually)
287
+ <details>
288
+ # dispatch workflow
289
+ gh api /repos/ipfs/npm-go-ipfs/actions/workflows/main.yml/dispatches \
290
+ --method POST \
291
+ -f ref='master'
292
+
293
+ # get workflow run
294
+ gh api /repos/ipfs/npm-go-ipfs/actions/workflows/main.yml/runs \
295
+ --method GET \
296
+ -f per_page='1' \
297
+ --jq '.workflow_runs[0]'
298
+
299
+ # get workflow job
300
+ gh api /repos/ipfs/npm-go-ipfs/actions/runs/3470515021/jobs \
301
+ --method GET \
302
+ -f per_page='1' \
303
+ --jq '.jobs[0]'
304
+
305
+ # check logs for version
306
+ gh api /repos/ipfs/npm-go-ipfs/actions/jobs/9499319520/logs \
307
+ --method GET | grep -q '0.17.0-rc1'
308
+ echo $?
309
+ </details>
310
- [ ] Cut a pre-release on [GitHub](https://github.com/ipfs/kubo/releases) ([instructions](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release), [example](https://github.com/ipfs/kubo/releases/tag/v0.16.0-rc1))
311
- Use `vX.Y.Z-rcN` as the tag.
312
- Link to the release issue in the description.
313
- Link to the relevant [changelog](https://github.com/ipfs/kubo/blob/master/docs/changelogs/) in the description.
314
- Check `This is a pre-release`.
315
+ <details>
316
+ # create a pre-release
317
+ body='See the related issue: https://github.com/ipfs/kubo/issues/9319
318
+
319
+ And the draft changelog: [docs/changelogs/v0.17.md](https://github.com/ipfs/kubo/blob/release-v0.17.0/docs/changelogs/v0.17.md)'
320
+ gh api /repos/ipfs/kubo/releases \
321
+ --method POST \
322
+ -f tag_name='v0.17.0-rc1' \
323
+ -f name='v0.17.0-rc1' \
324
+ -f body="${body}" \
325
+ -F draft=false \
326
+ -F prerelease=true \
327
+ -F generate_release_notes=false \
328
+ -F make_latest=false
329
+ </details>
330
- [ ] Synchronize release artifacts by running [sync-release-assets](https://github.com/ipfs/kubo/actions/workflows/sync-release-assets.yml) workflow.
331
+ <details>
332
+ # dispatch workflow
333
+ gh api /repos/ipfs/kubo/actions/workflows/sync-release-assets.yml/dispatches \
334
+ --method POST \
335
+ -f ref='master'
336
+ </details>
337
- [ ] Announce the RC
338
- [ ] Create a new post on [IPFS Discourse](https://discuss.ipfs.tech). ([example](https://discuss.ipfs.tech/t/kubo-v0-16-0-rc1-release-candidate-is-out/15248))
339
- Use `Kubo vX.Y.Z-rcn Release Candidate is out!` as the title.