[[!meta title="Releasing persistence-setup"]]

[[!toc levels=1]]

Install build and test dependencies
===================================

    sudo apt install \
       libdist-zilla-perl \
       libdist-zilla-plugins-cjm-perl \
       libdist-zilla-plugin-installguide-perl \
       libdist-zilla-plugin-localemsgfmt-perl \
       libdist-zilla-plugin-test-perl-critic-perl \
       libdist-zilla-plugin-test-notabs-perl \
       libdist-zilla-plugin-git-perl \
       dh-make-perl

Make an upstream release
========================

    git checkout master

Enable new translations in `po/PACKAGE` and commit.

Export new upstream version number:

    export VERSION=XXX

Update version number in `bin/tails-persistence-setup`:

    perl -pi -E 's,^Version [0-9.]+,Version $ENV{VERSION},' bin/tails-persistence-setup
    perl -pi -E "s,^our \\\$VERSION = '[0-9.]+';\$,our \\\$VERSION = '$VERSION';," bin/tails-persistence-setup

Commit all files that need to be:

    git commit bin/tails-persistence-setup -m "tails-persistent-setup $VERSION"

Build an upstream tarball, tag the release, move the tarball out of
the build repository and cleanup:

    dzil build && \
       git tag -s $VERSION -m "tails-persistent-setup $VERSION" && \
       mv Tails-Persistence-*.tar.gz .. && \
       rm -rf Tails-Persistence-* .build po/*.mo

Update the Debian package
=========================

Checkout the Debian packaging branch and import the new upstream tarball:

    git checkout debian && \
       gbp import-orig --upstream-vcs-tag=$VERSION ../Tails-Persistence-$VERSION.tar.gz

Update `debian/changelog`:

    gbp dch && dch -e

(Do not forget to set the appropriate release.)

Commit `debian/changelog`:

        git commit debian/changelog -m "$(head -n 1 debian/changelog | sed -e 's,).*,),')

Git-Dch: Ignore
"

Build a Debian package (use a Jessie/i386 chroot, that
has 1. either tails-perl5lib installed, or the Tails APT repository
configured; and 2. `jessie-backports` APT sources configured):

    gbp buildpackage

If everything is fine, add a signed tag to the repository and push the
changes:

    gbp buildpackage --git-tag-only --git-sign-tags && \
    git push origin master:master \
                   debian:debian \
                   pristine-tar:pristine-tar \
                   upstream:upstream && \
    git push --tags

(Make sure `master`, `upstream`, `debian` and `pristine-tar` were all pushed.)

Add the Debian package to Tails
===============================

Sign the package:

    debsign $CHANGES_FILE

Upload:

    dupload --to tails $CHANGES_FILE
