summaryrefslogtreecommitdiffstats
path: root/wiki/src/contribute/release_process.mdwn
blob: 291f19576b5e196f68c47720ef342153accb5ca4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
[[!meta title="Release process"]]

[[!toc levels=2]]

See the [[release_schedule]].

Environment
===========

Export the following environment variables to be able to copy'n'paste
the scripts snippets found on this page:

* version numbers (see [[contribute/release_schedule#versioning]]):

      export VERSION=$(dpkg-parsechangelog -SVersion)
      export TAG=$(echo "$VERSION" | sed -e 's,~,-,')
      export PREVIOUS_VERSION=$(dpkg-parsechangelog --offset 1 --count 1 -SVersion)

* `NEXT_PLANNED_VERSION`: set to the version number of the next Tails release
  (e.g. 0.23 when releasing 0.22.1, and 1.3 when releasing 1.2)
* `MAJOR_RELEASE`: set to 1 if preparing a major release, to 0 else
* `ISOS`: the directory where one stores `tails-i386-*`
  sub-directories like the ones downloaded with BitTorrent.
* `ARTIFACTS`: the directory where build artifacts (e.g.
  the `.packages` file) land.
* `MASTER_CHECKOUT`: a checkout of the `master` branch of the main
  Tails Git repository.
* `RELEASE_BRANCH`: the name of the branch of the main Tails Git
  repository used to prepare the release (`stable` or `testing`).
* `RELEASE_CHECKOUT`: a checkout of the branch of the main Tails Git
  repository used to prepare the release (`stable` or `testing`).
* `TAILS_SIGNATURE_KEY=A490D0F4D311A4153E2BB7CADBB802B258ACD84F`
* `IUK_CHECKOUT`: a checkout of the relevant tag of the `iuk`
  Git repository.
* `PERL5LIB_CHECKOUT`: a checkout of the relevant tag of the
  `perl5lib` Git repository.
* `DIST`: either 'alpha' (for RC:s) or 'stable' (for actual releases)

Pre-freeze
==========

The [[contribute/working_together/roles/release_manager]] role
documentation has more tasks that should be done early enough.

Update Tor Browser preferences
------------------------------

* update `extensions.adblockplus.currentVersion` in
  `config/chroot_local-includes/etc/tor-browser/profile/preferences/0000tails.js`

Update Icedove preferences
------------------------------

* update `extensions.enigmail.configuredVersion` in
  `config/chroot_local-includes/etc/skel/.icedove/profile.default/preferences/0000tails.js`

Coordinate with Debian security updates
---------------------------------------

See [[release_process/Debian_security_updates]].

Select the right branch
=======================

What we refer to as the "release branch" (and `RELEASE_BRANCH`) should
be `testing` for major releases, and `stable` for point-releases.

<div class="caution">
Read the remainder of this document from the branch used to prepare the release!
</div>

Freeze
======

Major release
-------------

If we are at freeze time for a major release:

1. Merge the `master` Git branch into `devel`:

        git checkout devel && git merge --no-ff origin/master

2. [[Merge each APT overlay suite|APT_repository/custom#workflow-merge-overlays]]
   listed in the `devel` branch's `config/APT_overlays.d/` into the `devel`
   APT suite.

3. Merge the `devel` Git branch into the `testing` one:

        git checkout testing && git merge devel

   ... and check that the resulting `config/APT_overlays.d/` in the
   `testing` branch is empty.

4. [[Hard reset|APT_repository/custom#workflow-reset]] the `testing`
   custom APT suite to the current state of the `devel` one.

5. [[Freeze|APT_repository/time-based_snapshots#freeze]] the
   time-based APT repository snapshots that shall be used
   during the freeze.

6. Make it so the time-based APT repository snapshots are kept around
   long enough, by bumping their `Valid-Until` to max(now + 10 days,
   expected release date + 5 days):
   [[APT_repository/time-based_snapshots#bump-expiration-date-for-all-snapshots]]


Point-release
-------------

If we are at freeze time for a point-release:

1. Merge the `master` Git branch into `stable`:

        git checkout stable && git merge --no-ff origin/master

2. [[Merge each APT overlay suite|APT_repository/custom#workflow-merge-overlays]]
   listed in the `stable` branch's `config/APT_overlays.d/` into the `stable`
   APT suite.

Common steps for point and major releases
-----------------------------------------

Reset the release branch's `config/base_branch`:

        echo "${RELEASE_BRANCH}" > config/base_branch && \
           git commit config/base_branch \
               -m "Restore ${RELEASE_BRANCH}'s base branch."

Update included files
=====================

AdBlock patterns
----------------

Patterns are stored in
`config/chroot_local-includes/etc/tor-browser/profile/adblockplus/`.

1. Boot Tails
2. Start the tor Browser and open *Tools* → *Addons*
3. Select *Adblock Plus* in extensions
4. Open *Preferences* → *Filter preferences…*
5. For each filters, click *Actions* → *Update filters*
6. Close the Tor Browser
7. Copy the `.tor-browser/profile.default/adblockplus/patterns.ini` from
   this Tor Browser instance to the
   `config/chroot_local-includes/etc/tor-browser/profile/adblockplus`
   directory in the Tails Git checkout.
8. Commit:

       git commit -m 'Update AdBlock Plus patterns.' \
          config/chroot_local-includes/etc/tor-browser/profile/adblockplus/patterns.ini

Upgrade bundled binary Debian packages
--------------------------------------

That is: make sure the bundled binary Debian packages contain
up-to-date localization files.

For each bundled Debian package, `cd` into the package's root
directory (e.g. a checkout of the `whisperback` repository),
and then run the `import-translations` script that is in the
main Tails repository. For example:

	cd whisperback
	"$RELEASE_CHECKOUT"/import-translations

If the `import-translations` script fails to import translations for
the current package, manually copy updated PO files from the
Transifex branches of `git://git.torproject.org/translation.git` (e.g.
`whisperback_completed`) instead. In this case, skip PO files for
[[translation teams that use Git|contribute/how/translate#translate]].

Add and commit.

Then check the PO files:

	"$RELEASE_CHECKOUT"/submodules/jenkins-tools/slaves/check_po

Correct any displayed error, then commit the changes if any.

Then see the relevant release processes, and upload the packages to
the release branch's custom APT suite:

* [[tails-installer]]
* [[tails-greeter]]
* [[perl5lib]]
* [[persistence-setup]]
* [[tails-iuk]]
* whisperback:
  * follow [upstream release process](https://git-tails.immerda.ch/whisperback/plain/HACKING)
  * build a Debian package

Upgrade Tor Browser
-------------------

See the dedicated page: [[tor-browser]]

Update PO files
---------------

Pull updated translations for languages translated in Transifex,
refresh the code PO files,
and commit the result, including new PO files:

	cd "$RELEASE_CHECKOUT" && \
	./import-translations  && \
	./refresh-translations && \
	./submodules/jenkins-tools/slaves/check_po && \
	git add po && git commit -m 'Update PO files.'

If `check_po` complains:

* delete the offending PO files;
* send a note to <tails-l10n@boum.org> so that they get in touch with
  whoever can fix them.

When preparing an actual release
================================

If we're about to prepare an image for a final (non-RC) release, then
follow these instructions:

Major release
-------------

[[Merge each APT overlay suite|APT_repository/custom#workflow-merge-overlays]]
listed in the `testing` branch's `config/APT_overlays.d/` into the `testing`
custom APT suite.

Point-release
-------------

<div class="note">
For point-releases, we generally do not put any RC out, so freeze time
is the same as preparing the actual release. Hence, the following
steps have already been done above, and this section is a noop in the
general case.
</div>

[[Merge each APT overlay suite|APT_repository/custom#workflow-merge-overlays]]
listed in the `stable` branch's `config/APT_overlays.d/` into the `stable`
custom APT suite.

Update other base branches
==========================

1. Merge the release branch into `devel` following the instructions for
   [[merging base branches|APT_repository/custom#workflow-merge-main-branch]].

2. Merge `devel` into `feature/stretch` following the instructions for
   [[merging base branches|APT_repository/custom#workflow-merge-main-branch]].
   Given that these two branches' APT suites have diverged a lot, and
   that `tails-merge-suite` currently happily overwrites newer
   packages in the target with older packages from the source, it's
   probably easier to just merge each individual APT overlay that was
   just merged into the release branch into `feature/stretch`'s APT
   suite. Also, most of our just upgraded bundled packages
   (e.g. `tails-greeter`) may need to be rebuilt for Stretch.

3. Ensure that the release, `devel` and `feature/stretch` branches
   have the expected content in `config/APT_overlays.d/`: e.g. it must
   not list any overlay APT suite that has been merged already.

4. Push the modified branches to Git:

        git push origin                          \
           "${RELEASE_BRANCH}:${RELEASE_BRANCH}" \
           feature/stretch:feature/stretch       \
           devel:devel

Update more included files
==========================

Changelog
---------

Remove the placeholder entry for next release in `debian/changelog`,
and then:

	git checkout "$RELEASE_BRANCH" && \
	./release $VERSION $PREVIOUS_VERSION

This populates the Changelog with the Git log entries.

Then, launch an editor for the needed cleanup of the result:

	dch -e

Then, gather other useful information from:

* every custom bundled package's own Changelog (Greeter, Persistent
  Volume Assistant, etc.);
* the diff between the previous version's `.packages` file and the one
  from the to-be-released ISO;
* the "Fix committed" section on the *Release Manager View for $VERSION*
  in Redmine.

Finally, sanity check the version and commit:

	if [ "$(dpkg-parsechangelog -SVersion)" = "${VERSION}" ]; then
	    git commit debian/changelog -m "Update changelog for $VERSION."
	else
	    echo 'Error: version mismatch: please compare $VERSION with the last entry in debian/changelog'
	fi

Included website
----------------

### Merge master

Merge `master` into the branch used for the release:

	git fetch origin && git merge origin/master

### version number

If preparing a RC, skip this part.

In the branch used to build the release, update the `wiki/src/inc/*` files to
match the *version number* and *date* of the new release. Set the date
at least 24 hours in the future! Between tests and mirror synchronization,
the build will not be released on the same day. Try to make sure it
matches the date of the future signature.

	RELEASE_DATE='2015-11-03'

	echo "$VERSION"      > wiki/src/inc/stable_i386_version.html
	echo -n "$RELEASE_DATE" > wiki/src/inc/stable_i386_date.html
	sed -ri "s%news/version_.*]]%news/version_$VERSION]]%" wiki/src/inc/stable_i386_release_notes.*
	$EDITOR wiki/src/inc/*.html
	./build-website
	git commit wiki/src/inc/ -m "Update version and date for $VERSION."

### features and design documentation

Read the Changelog carefully, and update [[doc/about/features]]
pages accordingly.

Website translations
--------------------

Refresh the website PO files and commit the ones corresponding to
pages that were added or changed accordingly to changes coming with
the new release. This e.g. ensures that the RC call for translation
points translators to up-to-date PO files:

	./build-website && git add wiki/src && git commit -m 'Update website PO files.'
	git push origin "${RELEASE_BRANCH}:${RELEASE_BRANCH}"

Call for translation
====================

If at freeze time, send a call for translations to tails-l10n, making it clear what
Git branch the translations must be based on, and what are the
priorities. Also, add a few words to remember the translation teams
using Git that they should regularly contact Transifex translators,
as detailed on the [[documentation for
translators|contribute/how/translate]].

To get a list of changes on the website:

    git diff --stat ${PREVIOUS_VERSION}.. -- \
        *.{mdwn,html} \
        ':!wiki/src/blueprint*' \
        ':!wiki/src/contribute*' \
        ':!wiki/src/inc' \
        ':!wiki/src/news*' \
        ':!wiki/src/security*'

Import the signing key
======================

Skip this part if you have a Tails signing subkey on an OpenPGPG
smartcard, i.e. if you are one of the usual release managers. This is
only relevant when the master key has been reassembled, e.g. for
signing a Tails emergency release where none of the usual release
managers are available.

You should never import the Tails signing key into your own keyring,
and a good practice is to import it to a tmpfs to limit the risks that
the private key material is written to disk:

    export GNUPGHOME=$(mktemp -d)
    sudo mount -t ramfs ramfs "$GNUPGHOME"
    sudo chown $(id -u):$(id -g) "$GNUPGHOME"
    sudo chmod 0700 "$GNUPGHOME"
    gpg --homedir $HOME/.gnupg --export $TAILS_SIGNATURE_KEY | gpg --import
    gpg --import path/to/private-key

Let's also ensure that strong digest algorithms are used for our
signatures, like the defaults we set in Tails:

    cp config/chroot_local-includes/etc/skel/.gnupg/gpg.conf "$GNUPGHOME"

Build the almost-final image
============================

1. [[Build an ISO image|contribute/build]] from the release branch.
2. Carefully read the build logs to make sure nothing bad happened.
3. Keep at least the resulting ISO image and the manifest of needed
   packages until the end of this release process.
4. Record where the manifest of needed packages is stored:

        export PACKAGES_MANIFEST=XXX ; \
        [ -f "$PACKAGES_MANIFEST" ] || echo "ERROR: PACKAGES_MANIFEST is incorrect"


Tag the release in Git
======================

	git tag -u "$TAILS_SIGNATURE_KEY" \
	  -m "tagging version ${VERSION}" "${TAG}" && \
	git push --tags origin "${RELEASE_BRANCH}"

(Pushing the tag is needed so that the APT repository is updated, and
the Tails APT configuration works at build and boot time. It might be
premature, as testing might reveal critical issues, but this is
a signed tag, so it can be overridden later. Yes, there is room for
improvement here.)

Prepare the versioned APT suites
================================

* [[Prepare the versioned APT suite in our custom APT repository|APT_repository/custom#workflow-post-tag]].

* Prepare tagged snapshots of upstream APT repositories:

          ./bin/tag-apt-snapshots "$PACKAGES_MANIFEST" "$TAG"

  Note:

  - This command can take a while (about a dozen minutes).
  - It's expected that the packages that were pulled from our
    [[custom APT repository|APT_repository/custom]] are
    listed under "some packages were not found anywhere" (because we
    are current not using time-based snapshots for our custom APT
    repository). However, _no other package should be on that list_.
    Now, we have a "safety" net, in case you don't notice such a problem: if
    other packages are missing, the next build (that will use the
    newly created partial, tagged APT repository) will fail.

Build images
============

Sanity check
------------

Verify that the TBB release used in Tails still is the most
recent. Also look if there's a new `-buildX` tag for the targetted TBB
and Tor Browser versions in their respective Git repos:

* <https://gitweb.torproject.org/builders/tor-browser-bundle.git>
* <https://gitweb.torproject.org/tor-browser.git>

A new tag may indicate that a new TBB release is imminent.

Better catch this before people spend time doing manual tests.

SquashFS file order
-------------------

1. Burn the almost final ISO image to a DVD.
1. Boot this DVD **on bare metal**.
1. Add `profile` to the kernel command-line.
1. Login.
1. Wait for the "Tor is ready" notification.
1. Start the web browser.
1. A few minutes later, once the `boot-profile` process has been
   killed, retrieve the new sort file from `/var/log/boot-profile`.
1. Copy the new sort file to `config/binary_rootfs/squashfs.sort`.
1. Cleanup a bit:
   - remove `var/log/live/config.pipe`: otherwise the boot is broken
     or super-slow
   - remove the bits about `kill-boot-profile` at the end: they're
     only useful when profiling the boot
1. Inspect the Git diff (including diff stat), apply common sense.
   The following command is also helpful but requires that you save a
   copy of the old sort file into `/tmp/squashfs.sort.old`:

       diff -NaurB \
           <( cut -d' ' -f1 /tmp/squashfs.sort.old | sort ) \
           <( cut -d' ' -f1 config/binary_rootfs/squashfs.sort | sort ) \
           | less

1. `git commit -m 'Updating SquashFS sort file' config/binary_rootfs/squashfs.sort`

Build the final image
---------------------

Then all included files should be up-to-date and the versioned APT
suite should be ready, so it is time to:

* Mark the version as "released" in the changelog:

      dch --release --no-force-save-on-release --maintmaint
      git commit -m "Mark Tails ${VERSION} as released." debian/changelog

* tag the release *again*, with all included files in:
  
      git tag -f -u "$TAILS_SIGNATURE_KEY" \
              -m "tagging version ${VERSION}" "${TAG}" && \
      git push origin "${RELEASE_BRANCH}" && \
      git push --tags --force

* check out the release tag:

      git checkout "${TAG}"

* build the final image!

* compare the new build manifest with the one from the previous,
  almost final build; they should be identical

* check out the release branch again:

      git checkout "${RELEASE_BRANCH}"

Generate the OpenPGP signatures and Torrents
============================================

First, create a directory with a suitable name and go there:

	mkdir "$ISOS/tails-i386-$VERSION" && \
	cd "$ISOS/tails-i386-$VERSION"

Second, move the built image to this brand new directory:

	mv "$ARTIFACTS/tails-i386-$VERSION.iso" \
	   "$ISOS/tails-i386-$VERSION/"

Third, generate detached OpenPGP signatures for the image to be
published, in the same directory as the image and with a `.sig`
extension; e.g.

	gpg --armor --default-key "$TAILS_SIGNATURE_KEY" --detach-sign *.iso
	rename 's,\.asc$,.sig,' *.asc

Fourth, go up to the parent directory, create a `.torrent` file and
check the generated `.torrent` files metainfo:

	cd .. && \
	mktorrent \
	  -a 'udp://tracker.torrent.eu.org:451' \
	  -a 'udp://tracker.coppersurfer.tk:6969'   \
	  "tails-i386-${VERSION}" && \
	btshowmetainfo tails-i386-$VERSION.torrent

Lastly, let's set some variables to be used later:

    ISO_PATH="${ISOS}/tails-i386-${VERSION}/tails-i386-${VERSION}.iso"
    ISO_SHA256SUM="$(sha256sum "${ISO_PATH}" | cut -f 1 -d ' ' | tr -d '\n')"
    ISO_SIZE_IN_BYTES="$(stat -c %s "${ISO_PATH}")"

<a id="prepare-iuk"></a>

Prepare incremental upgrades
============================

Build the Incremental Upgrade Kits
----------------------------------

Use `tails-create-iuk` to build the following IUKs:

* From the previous stable release, e.g. 1.0 to 1.0.1 or 1.0 to
  1.0.1~rc1. This may be skipped if the delta is too big (like when
  migrating to a new Debian release) or if there are changes outside
  of the scope for IUKs (like partition table changes).

* From the last RC for the version being released, e.g. 1.0~rc1 to
  1.0. This should be done even if there was no IUK generated from the
  previous stable release since it is a good way to test the iuk code
  that'll be used for the incremental upgrade paths to the
  next version.

Example (for RC, replace `$PREVIOUS_VERSION` with e.g. `$VERSION~rc1`
below):

    sudo su -c "cd $IUK_CHECKOUT && \
      PERL5LIB=\"$PERL5LIB_CHECKOUT/lib\" \
        ./bin/tails-create-iuk \
           --squashfs-diff-name \"$VERSION.squashfs\"           \
           --old-iso \"$ISOS/tails-i386-$PREVIOUS_VERSION/tails-i386-$PREVIOUS_VERSION.iso\" \
           --new-iso \"$ISOS/tails-i386-$VERSION/tails-i386-$VERSION.iso\"          \
           --outfile \"$ISOS/Tails_i386_${PREVIOUS_VERSION}_to_${VERSION}.iuk\""

Note that developer tools for creating IUK and upgrade-description
files were only tested on Debian sid. It should hopefully work well on
Jessie too.

<a id="prepare-upgrade-description-files"></a>

Prepare upgrade-description files
---------------------------------

1. Prepare upgrade-description files (see the [[upgrade-description
   files
   specification|contribute/design/incremental_upgrades#upgrade-description-files]]
   for details). The idea is to:

   * update (create if needed) an upgrade-description file for every
     *previous* supported release (e.g. N~rc1, N-1, N-1~rc2) that replaces
     all existing upgrade paths with the path to the version being
     released;
   * create a new upgrade-description for the version being released,
     that expresses that *no* upgrade is available for that one yet.

   This is what `tails-iuk-generate-ugrade-description-files` tool
   does:

       ( cd $IUK_CHECKOUT && \
       ./bin/tails-iuk-generate-upgrade-description-files \
           --version "$VERSION" \
           --next-version "$NEXT_PLANNED_VERSION" \
           --next-version "${NEXT_PLANNED_VERSION}~rc1" \
           --next-version "${VERSION}.1" \
           --iso "$ISOS/tails-i386-$VERSION/tails-i386-$VERSION.iso" \
           --previous-version "$PREVIOUS_VERSION" \
           --previous-version "${VERSION}~rc1" \
           --iuks "$ISOS" \
           --release-checkout "$RELEASE_CHECKOUT" \
           --major-release "$MAJOR_RELEASE" \
       )

   Note:
   * The `--iuks` argument must point to the directory where the IUKs
     generated at the previous step are stored.
   * At least the last stable release and the previous release
     candidates for the version being released must be passed to
     `--previous-version`.
   * Older versions for which there is no incremental upgrade path to
     the new release must be passed with `--previous-version`, so that
     users who skipped a release or two are informed of the new one.
     Note that multi-steps incremental upgrade paths are valid and
     supported: e.g. when releasing 1.1.2, 1.1 users should still be
     able to incrementally upgrade to 1.1.1, and in turn to 1.1.2; to
     make this work, one must _not_ pass `--previous-version 1.1`,
     that would remove the existing incremental upgrade path from 1.1
     to 1.1.1.
   * If preparing a release candidate, add `--channel alpha`
   * If preparing a release candidate, drop all `--next-version`
     arguments, and instead pass (**untested!**)
     `--next-version $(echo $VERSION | sed -e 's,~rc*$,,')`
   * If preparing a point-release, pass neither
     `--next-version "${VERSION}.1"`,
     nor `--next-version "${VERSION}.1~rc1"`

1. Create an armoured detached signature for each created or modified
   upgrade-description file.

       find "${RELEASE_CHECKOUT}/wiki/src/upgrade/" \
          -type f -name upgrades.yml | \
          while read udf; do
              if [ -n "$(git status --porcelain "${udf}")" ]; then
                  gpg -u "${TAILS_SIGNATURE_KEY}" --armor --detach-sign "${udf}"
                  mv "${udf}.asc" "${udf}.pgp"
                  ( \
                    cd $IUK_CHECKOUT && \
                    ./bin/tails-iuk-check-upgrade-description-file "${udf}" \
                  ) || break
              fi
          done

1. Add and commit the upgrade-description files and their detached
   signatures to the Git branch used to prepare the release (`stable`
   or `testing`):

       ( cd "$RELEASE_CHECKOUT" && git add wiki/src/upgrade && \
          git commit -m "Update upgrade-description files." )

1. If preparing a release candidate, move the generated or updated
   files to `$MASTER_CHECKOUT`, commit and push: given the updates are
   advertised on the *alpha* channel, while all users use the *stable*
   one by default, this will allow you to more easily test the IUK
   without impacting anyone.

Prepare the ISO description file for DAVE
-----------------------------------------

If preparing a RC, skip this part.

Update the ISO description file (IDF) used by the browser extension:

    cat > "$RELEASE_CHECKOUT"/wiki/src/install/v1/Tails/i386/stable/latest.yml <<EOF
    ---
    build-target: i386
    channel: stable
    product-name: Tails
    version: '${VERSION}'
    target-files:
    - sha256: ${ISO_SHA256SUM}
      size: ${ISO_SIZE_IN_BYTES}
      url: http://dl.amnesia.boum.org/tails/stable/tails-i386-${VERSION}/tails-i386-${VERSION}.iso
    EOF
    ( cd "${RELEASE_CHECKOUT}" && \
      git add wiki/src/install/v1/Tails/i386/stable/latest.yml && \
      git commit -m "Update IDF file for DAVE." )

Upload images
=============

Sanity check
------------

Verify once more that the TBB we ship is still the most recent (see
above).

## Announce, seed and test the Torrents

Announce and seed the Torrents.

Test them with a BitTorrent client running in a different place.

## Download and seed image from lizard

    scp "$ISOS/tails-i386-$VERSION.torrent" \
       bittorrent.lizard: && \
       ssh bittorrent.lizard \
         transmission-remote --add tails-i386-$VERSION.torrent \
           --find /var/lib/transmission-daemon/downloads/

<a id="publish-iuk"></a>

Publish the ISO and IUK over HTTP
---------------------------------

Upload the images to the primary rsync mirror. Best practice is to first
let bittorrent.lizard download the image, and then copy it from there to
rsync.lizard:

    ssh lizard.tails.boum.org \
        scp -3 -r \
            bittorrent.lizard:/var/lib/transmission-daemon/downloads/tails-i386-$VERSION \
            rsync.lizard:
    ssh rsync.lizard << EOF
      chown -R root:rsync_tails \
         tails-i386-$VERSION \
         Tails_i386_${PREVIOUS_VERSION}_to_${VERSION}.iuk && \
      chmod -R u=rwX,go=rX \
         tails-i386-$VERSION \
         Tails_i386_${PREVIOUS_VERSION}_to_${VERSION}.iuk && \
      sudo mv tails-i386-$VERSION \
              /srv/rsync/tails/tails/$DIST/ && \
      sudo mv Tails_i386_${PREVIOUS_VERSION}_to_${VERSION}.iuk \
              /srv/rsync/tails/tails/$DIST/iuk/
    EOF

Update the time in `project/trace` file on the primary rsync mirror
and on the live wiki (even for a release candidate):

	TRACE_TIME=$(date +%s) &&
	echo $TRACE_TIME | ssh rsync.lizard "cat > /srv/rsync/tails/tails/project/trace" && \
	[ -n "$MASTER_CHECKOUT" ] && \
	echo $TRACE_TIME > "$MASTER_CHECKOUT/wiki/src/inc/trace" &&
	(
	   cd "$MASTER_CHECKOUT" && \
	   git commit wiki/src/inc/trace \
	      -m "Updating trace file after uploading $VERSION." && \
	   git push origin master
	)

ISO history
-----------

Push the released ISO to our Tails ISO history git-annex repo, so that
our isotesters can fetch it from there for their testing. How to do so
is described in our internal Git repo.

Update the website and Git repository
=====================================

What follows in this section happens on the release branch in
`$RELEASE_CHECKOUT`.

If preparing a final release
----------------------------

Skip this part if preparing a RC.

Rename the `.packages` file to remove the `.iso` and build date parts
of its name:

	mv "$ARTIFACTS"/tails-i386-"$VERSION".iso.packages \
	   "$ARTIFACTS/tails-i386-$VERSION.packages"

Rename the manifest of needed packages as well:

	mv "$PACKAGES_MANIFEST" "$ARTIFACTS/tails-i386-$VERSION.build-manifest"

Copy the `.iso.sig`, `.build-manifest`, `.packages`, `.torrent` and
`.torrent.sig` files into the website repository:

	cp "$ISOS/tails-i386-$VERSION/tails-i386-$VERSION.iso.sig" \
	   "$ARTIFACTS/tails-i386-$VERSION.build-manifest" \
	   "$ARTIFACTS/tails-i386-$VERSION.packages" \
	   "$ISOS/tails-i386-$VERSION.torrent" \
	   "$RELEASE_CHECKOUT/wiki/src/torrents/files/"

Remove from `wiki/src/torrents/files/` any remaining file from the
previous release (including any RC).

Update the size of the ISO image in `inc/*`:

        LC_NUMERIC=C ls -l -h $ISOS/tails-i386-$VERSION/tails-i386-$VERSION.iso | \
          cut -f 5 -d ' ' | sed -r 's/(.+)([MG])/\1 \2iB/' \
          > "$RELEASE_CHECKOUT/wiki/src/inc/stable_i386_iso_size.html"

Generate the expected signature verification output:

      gpg --keyid-format 0xlong --verify "${ISO_PATH}.sig" "${ISO_PATH}" 2>&1 | \
      sed 's/ /\&nbsp;/g;s/</\&lt;/;s/>/\&gt;/;s/$/<br\/>/g' > \
      "$RELEASE_CHECKOUT/wiki/src/inc/stable_i386_gpg_signature_output.html"

Update the [[support/known_issues]] page:

- Add regressions brought by the new release.
- Remove older known issues that are fixed by the new release.

Write the announcement for the release in
`wiki/src/news/version_$TAG.mdwn`, including:

- Update the `meta title` directive.
- Update the `meta date` directive.
- Make sure there's an `announce` tag to have an email sent to the
  news mailing list.
- Document important config changes that persistence users have to do
  themselves (e.g. the Pidgin proxy settings change in
  [[!tails_gitweb_commit 9925321]] breaks all existing persistent
  profiles).
- Document known issues.

Write an announcement listing the security bugs affecting the previous
version in
`wiki/src/security/Numerous_security_holes_in_${PREVIOUS_VERSION}.mdwn`
in order to let the users of the old versions
know that they have to upgrade. Date it a few days before the ISO
image to be released was *built*. Including:

- the list of CVE fixed in Linux since the one shipped in the previous
  release of Tails:
  <http://metadata.ftp-master.debian.org/changelogs/main/l/linux/stable_changelog>
- the list of DSA fixed in packages we ship since those that were in
  the previous release of Tails: <https://www.debian.org/security/#DSAS>
- the list of BSA fixed in packages we ship since those that were in
  the previous release of Tails:
  <https://lists.debian.org/debian-backports-announce/>
- the list of MFSA fixed by the Tor Browser update:
  <https://www.mozilla.org/security/announce/>

If preparing a release candidate
--------------------------------

Skip this part if preparing a final release.

Copy the `.iso.sig` file into the website repository:

	cp "${ISO_PATH}.sig" \
	   "$ISOS/tails-i386-${VERSION}.torrent" \
	      "${MASTER_CHECKOUT}/wiki/src/torrents/files/"

Write the announcement for the release in
`$MASTER_CHECKOUT/wiki/src/news/test_$TAG.mdwn`, including:

- Update the `meta title` directive.
- Update the `meta date` directive.
- Document important config changes that persistence users have to do
  themselves (e.g. the Pidgin proxy settings change in
  [[!tails_gitweb_commit 9925321]] breaks all existing persistent
  profiles).
- Document known issues.
- This snippet can help to convert the copied changelog's ticket
  references to links:

      sed -i 's@#\([0-9]\{4,5\}\)@[[!tails_ticket \1]]@g' \
          wiki/src/news/test_${TAG}.mdwn

In any case
-----------

Generate PO files for the announcements with `./build-website`.

Then, send them to <tails-l10n@boum.org> so that they get translated
shortly, perhaps even soon enough to integrate them before pushing the
release out officially.

Then, record the last commit before putting the release out for real:

	git add wiki/src && \
	git commit -m "releasing version ${VERSION}"

Testing
=======

1. Using `check-mirrors`, choose a fast mirror that already has the
   tentative ISO. E.g. <https://mirrors.kernel.org/tails/> or
   <https://mirrors.wikimedia.org/tails/> are reliable and have plenty
   of bandwidth.
1. Email <tails-testers@boum.org> to ask them to test the tentative
   ISO, pointing them to the up-to-date mirror you've found previously.
1. Set up a Gobby document and copy the [[manual test
   suite|contribute/release_process/test]] in it.
1. Email to <tails@boum.org> and potential contributors (see
   `manual_testers.mdwn` in the internal Git repository) that tests
   may start:
   - point them to the up-to-date mirror you've found previously
   - make it clear what's the deadline
   - make it clear where and how you expect to get feedback
   - attach the Torrent
   - attach the `.packages` file
1. Make sure someone is committed to run the automated test suite.
1. Make sure that enough people are here to run the tests, that they
   report their results in due time, and that they make it clear when
   they're leaving for good.
1. Fill the holes and make sure that the manual test suite is done in
   due time.
1. Triage test results, reproduce bugs as needed, decide what the next
   step is and make sure it happens: add to known issues? file ticket?
   release blocker?

Go wild!
========

Wait for the HTTP mirrors to catch up
-------------------------------------

Test downloading the ISO and IUK over HTTP.

Make sure every active mirror in the pool has the new version:

	./check-mirrors.rb --allow-multiple --fast tails-i386-$VERSION

Ask <tails-mirrors@boum.org> to drop those that are lagging behind and
notify their administrators.

Sanity check
------------

Verify once more that the TBB we ship is still the most recent (see
above).

Push
----

### Git

If preparing a release candidate, just push the `master` branch:

    git push origin master:master

If preparing an actual release, push the last commits to our Git
repository like this:

    ( cd "$RELEASE_CHECKOUT" && \
      git push origin "$RELEASE_BRANCH:$RELEASE_BRANCH" \
                      devel:devel \
    ) && \
    ( cd "$MASTER_CHECKOUT" && \
      git fetch && \
      git merge "$RELEASE_BRANCH" && \
      git push origin master:master \
    )


Bug tracker
-----------

Skip this part if preparing a release candidate.

Mark all issues fixed in this release as `Status: Resolved` in our bug
tracker. For a list of candidates, see:

* the [issues in *Fix committed*
  status](https://labs.riseup.net/code/projects/tails/issues?query_id=111);
* the "Fix committed" section on the *Release Manager View for $VERSION*
  in Redmine.

Then, mark the just-released Redmine milestone as done: go to the
target version page, click *Edit*, and set *Status* to *Closed*.

### Tickets linked from the website

Go through the tickets linked from the documentation and support sections of the
website and point documentation writers to the tickets that might be resolved in
this release.

    find wiki/src/{doc,support} -name "*.mdwn" -o -name "*.html" | xargs cat | \
        ruby -e 'puts STDIN.read.scan(/\[\[!tails_ticket\s+(\d+)[^\]]*\]\]/)' | \
        while read ticket; do
            url="https://labs.riseup.net/code/issues/${ticket}"
            url_content=$(curl --fail --silent ${url})
            if [ "${?}" -ne 0 ]; then
                echo "Failed to fetch ${url} so manually investigate #${ticket}" >&2
                continue
            fi
            status=$(echo "${url_content}" | \
                sed -n 's,^.*<th class="status">Status:</th><td class="status">\([^<]\+\)</td>.*$,\1,p')
            if [ "${status}" != "New" ] && \
               [ "${status}" != "Confirmed" ] && \
               [ "${status}" != "In Progress" ]; then
                echo "It seems ticket #${ticket} has been fixed (Status: ${status}) so please find all instances in the wiki and fix them. Ticket URL: ${url}"
            fi
        done

Remember that ticket expressions, e.g. `[[!tails_ticket 1234]]`, can
span several lines, so finding the ones reported by the above code
*might* be harder than `git grep "tails_ticket 1234"`.

Test suite
----------

Remove indications of known broken tests that were fixed by this
release:

	git grep XXX -- features

XMPP
----

Update the topic in our [[chatroom|chat]].

Twitter
-------

Announce the release by tweeting a link to the "news" page.

Tor blog
--------

We announce *major* releases on the Tor blog:

- [login to their Drupal](https://blog.torproject.org/user)
- *Add a New Blog Post*
- add the same tags as the previous release announce had
- choose *Filtered HTML* as the *Input format*
- paste the HTML generated by ikiwiki from the announce in `news/`
  into the textarea in the blog post editor
- cleanup a bit to make it shorter
- add a link to the [[installation assistant|install]]
- change the internal links into external links
- turn `<h1>` into `<strong>`
- direct users to [[our communication channels|support/talk]] for
  comments and feedback
- disable comments

Tor weekly news
---------------

Write a short announcement for the [Tor weekly
news](https://trac.torproject.org/projects/tor/wiki/TorWeeklyNews)'s
next issue (follow the *Next steps* link), or find someone who's happy
to do it.

Amnesia news
------------

The release announcement are automatically sent to `amnesia-news@`
(thanks to the `announce` flag) on an hourly basis, but it will be
stuck in the moderation
queue. [Log in](https://mailman.boum.org/admindb/amnesia-news) and
accept it.

Prepare for the next release
============================

XXX: adapt / fork for release candidates. In the meantime, read all
this, and skip what does not make sense for a RC.

1. If you just released a new stable release, remove the previous
   stable release on the mirrors.
1. Remove any remaining RC for the just-published release from
   the mirrors.
1. Remove IUKs that are more than 6 months old from
   `/{stable,alpha}/iuk` on the rsync server:
   - first check that it's not going to remove anything we want to keep:
     
         ssh rsync.lizard /bin/sh -c \
             \"find /srv/rsync/tails/tails/alpha  \
                    /srv/rsync/tails/tails/stable \
                    -type f -name '*.iuk' -mtime '+183' \
                    -not -name '*~test_*~test.iuk' -ls \
             \"
   
   - then actually delete the files:
     
         ssh rsync.lizard /bin/sh -c \
             \"find /srv/rsync/tails/tails/alpha  \
                    /srv/rsync/tails/tails/stable \
                    -type f -name '*.iuk' -mtime '+183' \
                    -not -name '*~test_*~test.iuk' -delete \
             \"

1. Delete Git branches that were merged:

        bare_repo=$(mktemp -d)
        (cd "$MASTER_CHECKOUT" && git fetch) && \
        (cd "$MASTER_CHECKOUT" && git submodule update) && \
        git clone --bare --reference "$MASTER_CHECKOUT" \
           boum_org_amnesia@webmasters.boum.org:wiki.git \
           "$bare_repo" && \
        PYTHONPATH=lib/python3 ./bin/delete-merged-git-branches \
           --repo "$bare_repo" && \
        rm -rf "$bare_repo"

1. Remove all old versions in `wiki/src/upgrade/v1/Tails` that were
   never released. Explanation: the post-release APT repository steps
   from the previous stable release will usually have had us prepare
   for an emergency release that was never made.
1. [[Thaw|APT_repository/time-based snapshots#thaw]] the time-based
   APT repository snapshots that were used during the freeze, if any.
1. [[Thaw the packages that were granted freeze exceptions|APT_repository/time-based snapshots#freeze-exceptions-post-release]].
1. Pull `master` back and merge it into `stable`, and in turn into
   `devel`
1. Follow the
   [[post-release|APT_repository/custom#workflow-post-release]]
   custom APT repository documentation. Make sure there are upgrade-description
   files for any new versions that were added.
1. Push the resulting branches.
1. Make sure Jenkins manages to build all updated major branches fine:
   <https://jenkins.tails.boum.org/>.
1. Delete the _Release Manager View for $VERSION_ Redmine custom query.
1. Ensure the next few releases have their own _Release Manager View_.
1. On the [[!tails_roadmap]], update the *Due date* for the *Holes
   in the Roof* so that this section appears after the next release.
1. If you will be the release manager for the next release, look at the
   tasks that must be done at the beginning of your shift in the
   [[release manager role page|contribute/working_together/roles/release_manager]].

Related pages
=============

[[!map pages="contribute/release_process/*"]]