Update IDF for download verification
[tails.git] / bin / prepare-included-website-for-release
blob208aead9ad939c24f5066afdb1ac36b24799d87a
1 #!/bin/bash
3 set -eu
4 set -x
6 # For git_current_branch
7 . "$(dirname "$0")"/../auto/scripts/utils.sh
9 ### Sanity checks
11 [ "$(git_current_branch)" = "${RELEASE_BRANCH:?}" ] \
12 || error "Not on branch '$RELEASE_BRANCH'"
14 ### Merge `master` into the branch used for the release
16 git fetch origin && git merge origin/master
18 if [ "$DIST" = stable ]; then # preparing a final release
19 echo "${VERSION:?}" > wiki/src/inc/stable_amd64_version.html
20 echo -n "${RELEASE_DATE:?}" > wiki/src/inc/stable_amd64_date.html
21 for type in img iso ; do
22 basename="tails-amd64-${VERSION:?}"
23 filename="${basename:?}.${type:?}"
24 echo "${filename:?}" \
25 > wiki/src/inc/stable_amd64_${type:?}_filename.html
26 echo "TZ=UTC gpg --no-options --keyid-format long --verify ${filename:?}.sig ${filename:?}" \
27 > wiki/src/inc/stable_amd64_${type:?}_gpg_verify.html
28 echo "https://download.tails.net/tails/stable/${basename:?}/${filename:?}" \
29 > wiki/src/inc/stable_amd64_${type:?}_url.html
30 echo "https://mirrors.wikimedia.org/tails/stable/${basename:?}/${filename:?}" \
31 > wiki/src/inc/stable_amd64_${type:?}_url_https.html
32 echo "https://tails.net/torrents/files/${filename:?}.sig" \
33 > wiki/src/inc/stable_amd64_${type:?}_sig_url.html
34 echo "https://tails.net/torrents/files/${filename:?}.torrent" \
35 > wiki/src/inc/stable_amd64_${type:?}_torrent_url.html
36 done
37 git commit wiki/src/inc/ -m "Update version and date for ${VERSION:?}."
40 ### Signing key downloaded by the Upgrader
42 TMP_GNUPG_HOME=$(mktemp -d)
43 gpg --homedir "${TMP_GNUPG_HOME:?}" --import wiki/src/tails-signing.key
44 gpg --homedir "${TMP_GNUPG_HOME:?}" \
45 --export-filter drop-subkey="revoked == 1" \
46 --export-options export-minimal \
47 --armor --export "${TAILS_SIGNATURE_KEY:?}" \
48 > wiki/src/tails-signing-minimal.key
49 git commit wiki/src/tails-signing-minimal.key \
50 -m "Update signing key used by the Upgrader" || :
51 rm -rf "${TMP_GNUPG_HOME:?}"
53 ### Translations
55 ./build-website --rebuild
56 git add wiki/src
57 git commit -m 'Update website PO files.'
59 ### Push
61 git push origin "${RELEASE_BRANCH:?}:${RELEASE_BRANCH:?}"