Debian Codegraph @

docs/software_dev/release.rst

raw
1 .. _release:
2
3 Release Workflow
4 ================
5
6 This section will describe how to create a new release.
7
8 Determine Version Number
9 ------------------------
10
11 The first thing you must do before creating a new release is determine the new (`semantic <https://semver.org/>`_) version number.
12
13 In this example, we'll be using ``v3.2.0``. That's
14
15 * a ``MAJOR`` version ``3``,
16 * a ``MINOR`` version ``2``, and
17 * a ``PATCH`` version ``0``
18
19 For this workflow, the ``PATCH`` version must always be ``0``, and it should only be incremented for hotfixes to previous releases--which is a :ref:`distinct workflow <hotfix>` from what's documented here.
20
21 ::
22
23 v 3 . 2 . 0 ⭠ PATCH
24 MAJOR ⮥ ⮤ MINOR
25
26 Create Release Branch
27 ---------------------
28
29 In our project, we only put production-ready stable code in the ``master`` branch. No commits should occur in ``master``. Most commits should be made in the ``dev`` branch (or in a feature-specific branch, then merged into ``dev``).
30
31 After a set of features to be included in your new release are finished, create a new release branch from the ``dev`` branch. Push this new branch to github.com
32
33 ::
34
35 user@host:~/buskill-app$ git checkout dev
36 Switched to branch 'dev'
37 user@host:~/buskill-app$ git checkout -b v3.2.0
38 Switched to a new branch 'v3.2.0'
39 user@host:~/buskill-app$
40 user@host:~/buskill-app$ git push origin v3.2.0
41 Total 0 (delta 0), reused 0 (delta 0)
42 remote:
43 remote: Create a pull request for 'v3.2.0' on GitHub by visiting:
44 remote: https://github.com/BusKill/buskill-app/pull/new/v3.2.0
45 remote:
46 To github.com:BusKill/buskill-app.git
47 * [new branch] v3.2.0 -> v3.2.0
48 user@host:~/buskill-app$
49
50 Finalize Release
51 ----------------
52
53 At this point, all of your features for the new release should already be finished, but there are some release-specific changes that may need to be committed, such as:
54
55 #. Updating CHANGELOG
56 #. Testing & minor patches
57 #. Updating documentation
58
59 ::
60
61 user@host:~/buskill-app/$ vim CHANGELOG
62 user@host:~/buskill-app/$ git commit -am 'updated changelog for new release'
63 user@host:~/buskill-app/$
64
65 Test
66 ----
67
68 Before release, :ref:`thoroughly test the code <test_app>` in your new release branch and commit directly to this branch.
69
70 When testing is finished, merge all the commits into both the ``master`` and ``dev`` branches.
71
72 ::
73
74 user@host:~/buskill-app$ git branch -l
75 dev
76 master
77 * v3.2.0
78 user@host:~/buskill-app$ git checkout dev
79 Switched to branch 'dev'
80 user@host:~/buskill-app$ git pull origin dev
81 From github.com:BusKill/buskill-app
82 * branch dev -> FETCH_HEAD
83 Already up to date.
84
85 user@host:~/buskill-app$ git merge refs/heads/v3.2.0
86 Updating f9e692a..3c1a6d5
87 Fast-forward
88 docs/software_dev/index.rst | 2 +-
89 docs/software_dev/release.rst | 54 +++++++++++++++++++++++++++++++++++++++++++
90 docs/software_dev/repo.rst | 6 -----
91 3 files changed, 55 insertions(+), 7 deletions(-)
92 create mode 100644 docs/software_dev/release.rst
93 delete mode 100644 docs/software_dev/repo.rst
94
95 user@host:~/buskill-app$ git checkout master
96 Switched to branch 'master'
97 Your branch is up to date with 'origin/master'.
98 user@host:~/buskill-app$ git pull origin master
99 From github.com:BusKill/buskill-app
100 * branch master -> FETCH_HEAD
101 Already up to date.
102
103 user@host:~/buskill-app$ git merge refs/heads/v3.2.0
104 Updating ab223f3..3c1a6d5
105 Fast-forward
106 docs/_extensions/affiliatelinks.py | 66 ++++++++++++++++++++++++++++
107 docs/attribution.rst | 1 +
108 docs/conf.py | 13 ++++++
109 docs/contributing.rst | 3 +-
110 docs/hardware_dev/assembly.rst | 7 +++
111 docs/hardware_dev/bom.rst | 83 ++++++++++++++++++++++++++++++++++++
112 docs/hardware_dev/index.rst | 7 ++-
113 docs/images/buskill_cable_usb_a.jpg | Bin 0 -> 457480 bytes
114 docs/index.rst | 7 +++
115 docs/software_dev/index.rst | 2 +-
116 docs/software_dev/release.rst | 54 +++++++++++++++++++++++
117 docs/software_dev/repo.rst | 6 ---
118 12 files changed, 239 insertions(+), 10 deletions(-)
119 create mode 100644 docs/_extensions/affiliatelinks.py
120 create mode 100644 docs/hardware_dev/assembly.rst
121 create mode 100644 docs/hardware_dev/bom.rst
122 create mode 100644 docs/images/buskill_cable_usb_a.jpg
123 create mode 100644 docs/software_dev/release.rst
124 delete mode 100644 docs/software_dev/repo.rst
125
126 user@host:~/buskill-app$ git checkout v3.2.0
127 Switched to branch 'v3.2.0'
128
129 user@host:~/buskill-app$ git push
130 Enumerating objects: 10, done.
131 Counting objects: 100% (10/10), done.
132 Delta compression using up to 4 threads
133 Compressing objects: 100% (6/6), done.
134 Writing objects: 100% (6/6), 2.10 KiB | 63.00 KiB/s, done.
135 Total 6 (delta 3), reused 0 (delta 0)
136 remote: Resolving deltas: 100% (3/3), completed with 3 local objects.
137 To github.com:BusKill/buskill-app.git
138 f9e692a..3c1a6d5 dev -> dev
139 ab223f3..3c1a6d5 master -> master
140 f9e692a..3c1a6d5 v3.2.0 -> v3.2.0
141 user@host:~/buskill-app$
142
143 Tag
144 ---
145
146 After you've merged your release branch into the ``master`` branch, create a tag for the new release in the ``master`` branch, and push that to github.com
147
148 ::
149
150 user@host:~/buskill-app$ git checkout master
151 Switched to branch 'master'
152 Your branch is up to date with 'origin/master'.
153
154 user@host:~/buskill-app$ git tag v3.2.0
155
156 user@host:~/buskill-app$ git push origin refs/tags/v3.2.0
157 Total 0 (delta 0), reused 0 (delta 0)
158 To github.com:BusKill/buskill-app.git
159 * [new tag] v3.2.0 -> v3.2.0
160 user@host:~/buskill-app$
161
162 .. _release_build:
163
164 Build & Sign
165 ------------
166
167 For Linux, use the docker `build script wrapper <https://github.com/BusKill/buskill-app/blob/master/build/linux/debianWrapper.sh>`_ to build the new release locally on your machine in a a Debian docker container as root. Get the sha256 checksum of the new AppImage and confirm that it matches the AppImage built by GitHub's CI process. If it doesn't, don't proceed with signing it. Our Linux releases should be fully reproducible_.
168
169 When downloading the AppImage from the repo's GitHub releases page, make sure the commits and branches exactly match your local build, else the checksum will differ because the contents of ``buskill_version.py`` will have a distinct ``GITHUB_REF``, ``GITHUB_SHA``, and ``SOURCE_DATE_EPOCH``.
170
171 ::
172
173 user@disp2781:~$ sudo su -
174 root@disp2781:~#
175
176 root@disp2781:~# git clone --single-branch --branch v3.2.0 https://github.com/BusKill/buskill-app.git
177 Cloning into 'buskill-app'...
178 remote: Enumerating objects: 21, done.
179 ...
180 root@disp2781:~# cd buskill-app
181 root@disp2781:~/buskill-app# git branch -l
182 * v3.2.0
183 root@disp2781:~/buskill-app#
184
185 root@disp2781:~/buskill-app# build/linux/debianWrapper.sh
186 ...
187 root@disp2781:~/buskill-app#
188
189 root@disp2781:~/buskill-app# sha256sum dist/*/*.AppImage
190 66ebab6c980d49d20526a184981ba36b34bdc18dea40a5b2ff995b281eebfe9d buskill-lin-v3.2.0-x86_64/buskill-v3.2.0.AppImage
191 root@disp2781:~/buskill-app#
192
193 root@disp2781:~/buskill-app# cd ..
194 root@disp2781:~# wget https://github.com/BusKill/buskill-app/releases/download/<epoch_seconds>_linux/buskill-lin-v3.2.0-x86_64.tbz
195 ...
196 root@disp2781:~# tar -xjf buskill-lin-v3.2.0-x86_64.tbz
197 root@disp2781:~# sha256sum */*.AppImage
198 66ebab6c980d49d20526a184981ba36b34bdc18dea40a5b2ff995b281eebfe9d buskill-lin-v3.2.0-x86_64/buskill-v3.2.0.AppImage
199 root@disp2781:~#
200
201 .. note::
202
203 For Windows & MacOS, there is an `upstream issue with reproducibility in PyInstaller <https://github.com/BusKill/buskill-app/issues/3>`_, so we have to choose to trust our local build or the GitHub CI build.
204
205 After verifying the reproducibility of the Linux build, download the Windows and MacOS builds from the corresponding GitHub release and verify their pre-release signatures.
206
207 ::
208
209 root@disp2781:~# curl --location --remote-name https://github.com/BusKill/buskill-app/releases/download/<epoch_seconds>_windows/buskill-win-v3.2.0-x86_64.zip
210 ...
211 root@disp2781:~# curl --location --remote-name https://github.com/BusKill/buskill-app/releases/download/<epoch_seconds>_windows/SHA256SUMS
212 ...
213 root@disp2781:~# curl --location --remote-name https://github.com/BusKill/buskill-app/releases/download/<epoch_seconds>_windows/SHA256SUMS.asc
214 ...
215 root@disp2781:~# gpg --verify SHA256SUMS.asc
216 gpg: Signature made Fri 31 Jul 2020 03:43:43 PM +0545
217 gpg: using RSA key 0B90809464D7B7A50E1871DE7DE9F38ADB5B1E8A
218 gpg: Good signature from "BusKill Pre-Releases Signing Key 2020.07 <[email protected]>" [unknown]
219 gpg: WARNING: This key is not certified with a trusted signature!
220 gpg: There is no indication that the signature belongs to the owner.
221 Primary key fingerprint: 713D 4A49 60EE 849B AE3B 41BA BE75 DB07 E34A FBC1
222 Subkey fingerprint: 0B90 8094 64D7 B7A5 0E18 71DE 7DE9 F38A DB5B 1E8A
223 root@disp2781:~#
224
225 root@disp2781:~# sha256sum -c SHA256SUMS
226 buskill-win-v3.2.0-x86_64.zip: OK
227 root@disp2781:~#
228
229 root@disp2781:~# rm SHA256SUMS*
230 root@disp2781:~#
231
232 root@disp2781:~# wget https://github.com/BusKill/buskill-app/releases/download/<epoch_seconds>_mac/buskill-mac-v3.2.0-x86_64.dmg
233 ...
234 root@disp2781:~# curl --location --remote-name https://github.com/BusKill/buskill-app/releases/download/<epoch_seconds>_mac/SHA256SUMS
235 ...
236 root@disp2781:~# curl --location --remote-name https://github.com/BusKill/buskill-app/releases/download/<epoch_seconds>_mac/SHA256SUMS.asc
237 ...
238 root@disp2781:~# gpg --verify SHA256SUMS.asc
239 gpg: Signature made Fri 31 Jul 2020 03:43:43 PM +0545
240 gpg: using RSA key 0B90809464D7B7A50E1871DE7DE9F38ADB5B1E8A
241 gpg: Good signature from "BusKill Pre-Releases Signing Key 2020.07 <[email protected]>" [unknown]
242 gpg: WARNING: This key is not certified with a trusted signature!
243 gpg: There is no indication that the signature belongs to the owner.
244 Primary key fingerprint: 713D 4A49 60EE 849B AE3B 41BA BE75 DB07 E34A FBC1
245 Subkey fingerprint: 0B90 8094 64D7 B7A5 0E18 71DE 7DE9 F38A DB5B 1E8A
246 root@disp2781:~# sha256sum -c SHA256SUMS
247 buskill-mac-v3.2.0-x86_64.dmg: OK
248 root@disp2781:~#
249
250 Finally, download and verify the authenticity of the source tarball against your local repo. Then sign it for downstream (eg `Debian <https://github.com/BusKill/buskill-app/issues/53>`_)
251
252 ::
253
254 cd $HOME/Downloads
255 wget https://github.com/BusKill/buskill-app/archive/refs/tags/v3.2.0.tar.gz
256 tar -xzf v3.2.0.tar.gz
257 cd $HOME/sandbox/buskill-app
258 git checkout refs/tags/v3.2.0
259 diff -rq . $HOME/Downloads/buskill-app-3.2.0/
260
261 Make sure the only differences is the existence of some files in your local repo that are not present in the `minimized <https://github.com/BusKill/buskill-app/issues/53#issuecomment-1366041678>`_ tarball. Do *not* proceed if there's any files that exist in both that are not identical.
262
263 Once you've verified the authenticity of everything above, move the 4 files to your dragon-protected basement-safe laptop, generate a new checksum file with all three platforms' releases, and sign it with the gpg release key.
264
265 After verifying the reproducibility of the Linux build, download the Windows and MacOS builds from the corresponding GitHub release and verify their pre-release signatures.
266
267 ::
268
269 user@vault:~$ ls
270 buskill-lin-v3.2.0-x86_64.tbz buskill-win-v3.2.0-x86_64.zip
271 buskill-mac-v3.2.0-x86_64.dmg v3.2.0.tar.gz
272 user@vault:~$
273
274 user@vault:~$ sha256sum * > SHA256SUMS
275 user@vault:~$
276
277 user@vault:~$ gpg --default-key 'E0AF FF57 DC00 FBE0 5635 8761 4AE2 1E19 36CE 786A' --armor -b SHA256SUMS
278 gpg: using "E0AF FF57 DC00 FBE0 5635 8761 4AE2 1E19 36CE 786A" as default secret key for signing
279 user@vault:~$
280
281 user@vault:~$ gpg --default-key 'E0AF FF57 DC00 FBE0 5635 8761 4AE2 1E19 36CE 786A' --armor -b v*.tar.gz*
282 gpg: using "E0AF FF57 DC00 FBE0 5635 8761 4AE2 1E19 36CE 786A" as default secret key for signing
283 user@vault:~$
284
285 user@vault:~$ ls
286 buskill-lin-v3.2.0-x86_64.tbz SHA256SUMS.asc
287 buskill-mac-v3.2.0-x86_64.dmg v3.2.0.tar.gz
288 buskill-win-v3.2.0-x86_64.zip v3.2.0.tar.gz.asc
289 SHA256SUMS
290 user@vault:~$
291
292 Upload
293 ------
294
295 Copy all of the above files off your airgapped machine.
296
297 Finally, upload the files to the tag's release using the github.com WUI
298
299 * `https://github.com/BusKill/buskill-app/releases/tag/v3.2.0 <https://github.com/BusKill/buskill-app/releases/tag/v3.2.0>`_
300
301 Update updates repo metadata
302 ----------------------------
303
304 At this point, users will be able to download v3.2.0 of the BusKill app from github.com, but existing users will not be able to click the update button in the app to upgrade their existing install to the latest version.
305
306 For apps to be able to know about the new version, we must update the ``meta.json`` file on the ``UPGRADE_MIRRORS`` hard-coded into the app:
307
308 #. `https://raw.githubusercontent.com/BusKill/buskill-app/master/updates/v1/meta.json <https://raw.githubusercontent.com/BusKill/buskill-app/master/updates/v1/meta.json>`_
309
310 #. `https://gitlab.com/buskill/buskill-app/-/raw/master/updates/v1/meta.json <https://gitlab.com/buskill/buskill-app/-/raw/master/updates/v1/meta.json>`_
311
312 #. `https://repo.buskill.in/buskill-app/v1/meta.json <https://repo.buskill.in/buskill-app/v1/meta.json>`_
313
314 #. `https://repo.michaelaltfield.net/buskill-app/v1/meta.json <https://repo.michaelaltfield.net/buskill-app/v1/meta.json>`_
315
316 First, update the file in the github repo in the v3.2.0 branch.
317
318 ::
319
320 user@host:~/buskill-app$ git checkout v3.2.0
321 warning: refname 'v3.2.0' is ambiguous.
322 Switched to branch 'v3.2.0'
323 user@host:~/buskill-app$
324
325 user@host:~/buskill-app$ git pull origin v3.2.0
326 From github.com:BusKill/buskill-app
327 * tag v3.2.0 -> FETCH_HEAD
328 Already up to date.
329 user@host:~/buskill-app$
330
331 user@host:~/buskill-app$ vim updates/v1/meta.json
332
333 Edit the file by hand. In the future, we'll switch to tuf when it's safe to do so
334
335 * `https://github.com/BusKill/buskill-app/issues/6#issuecomment-671087395 <https://github.com/BusKill/buskill-app/issues/6#issuecomment-671087395>`_
336 * `https://github.com/theupdateframework/tuf/issues/1109 <https://github.com/theupdateframework/tuf/issues/1109>`_
337
338 In ``meta.json``, make the following changes:
339
340 #. Change ``latest`` -> ``buskill-app`` -> ``stable`` to the latest version (eg ``v3.2.0``).
341
342 #. Add a new dictionary section to ``updates`` -> ``buskill-app`` with a value the same as the latest version that was set to ``stable`` in the previous step
343
344 #. Make sure that this new section's ``url`` keys (and ``SHA256SUMS`` & ``SHA256SUMS.asc`` files) contain a single-element array with the URL to download the latest build from github.com, as was uploaded in the previous section
345
346 After updating the ``meta.json`` file, copy it to your airgapped machine and sign it to create ``meta.json.asc``
347
348 ::
349
350 user@vault:~$ gpg --default-key 'E0AF FF57 DC00 FBE0 5635 8761 4AE2 1E19 36CE 786A' --armor -b meta.json
351 gpg: using "E0AF FF57 DC00 FBE0 5635 8761 4AE2 1E19 36CE 786A" as default secret key for signing
352 user@vault:~$
353
354 user@vault:~$ ls
355 meta.json meta.json.asc
356 user@vault:~$
357
358 Now copy-back the ``meta.json.asc`` file from your airgapped machine to overwrite the existing ``meta.json.asc`` file in your ``buskill-app`` sandbox. Commit, merge, and push.
359
360 ::
361
362 user@host:~/buskill-app$ git branch -l
363 dev
364 master
365 * v3.2.0
366 user@host:~/buskill-app/$
367
368 user@host:~/buskill-app/$ git commit -am 'updated meta.json to latest version for in-app updates'
369 [v3.2.0 daa5241] updated meta.json to latest version for in-app updates
370 2 files changed, 8 insertions(+), 8 deletions(-)
371 user@host:~/buskill-app$
372
373 user@host:~/buskill-app$ git checkout dev
374 Switched to branch 'dev'
375 Your branch is up to date with 'origin/dev'.
376 user@host:~/buskill-app$
377
378 user@host:~/buskill-app$ git pull origin dev
379 From github.com:BusKill/buskill-app
380 * branch dev -> FETCH_HEAD
381 Already up to date.
382 user@host:~/buskill-app$
383
384 user@host:~/buskill-app$ git merge refs/heads/v3.2.0
385 Updating 352f0e5..daa5241
386 Fast-forward
387 updates/v1/meta.json | 8 +-
388 updates/v1/meta.json.asc | 16 ++++
389 2 files changed, 24 insertions(+), 8 deletions(-)
390 user@host:~/buskill-app$
391
392 user@host:~/buskill-app$ git checkout master
393 Switched to branch 'master'
394 Your branch is up to date with 'origin/master'.
395 user@host:~/buskill-app$
396
397 user@host:~/buskill-app$ git pull origin master
398 From github.com:BusKill/buskill-app
399 * branch master -> FETCH_HEAD
400 Already up to date.
401 user@host:~/buskill-app$
402
403 user@host:~/buskill-app$ git merge refs/heads/v3.2.0
404 Updating 352f0e5..daa5241
405 Fast-forward
406 updates/v1/meta.json | 8 +-
407 updates/v1/meta.json.asc | 16 ++++
408 2 files changed, 24 insertions(+), 8 deletions(-)
409 user@host:~/buskill-app$
410
411 user@host:~/buskill-app$ git checkout v3.2.0
412 warning: refname 'v3.2.0' is ambiguous.
413 Switched to branch 'v3.2.0'
414 user@host:~/buskill-app$
415
416 user@host:~/buskill-app$ git push
417 Enumerating objects: 23, done.
418 Counting objects: 100% (23/23), done.
419 Delta compression using up to 4 threads
420 Compressing objects: 100% (13/13), done.
421 Writing objects: 100% (14/14), 4.20 KiB | 860.00 KiB/s, done.
422 Total 14 (delta 8), reused 0 (delta 0)
423 remote: Resolving deltas: 100% (8/8), completed with 8 local objects.
424 To github.com:BusKill/buskill-app.git
425 352f0e5..daa5241 dev -> dev
426 352f0e5..daa5241 master -> master
427 caaf2e8..daa5241 v3.2.0 -> v3.2.0
428 user@host:~/buskill-app$
429
430 Now test that in-app upgrades from the previous version are functioning properly.
431
432 Finally, make sure to propogate the ``meta.json`` and ``meta.json.asc`` files to all mirrors.
433
434 .. _reproducible: https://github.com/BusKill/buskill-app/issues/3