Steps before a release is done
------------------------------

Check all is crispy

  rm -rf build dist
  ./setup.py clean build
  ./setup.py clean sdist


Edit the ``fades/_version.py`` file properly, then tag and commit/push

  git tag release-VERSION
  git commit -am "Release VERSION"
  git push --tag


How to release it to PyPI
-------------------------

Dead simple:

  rm -rf build dist
  ./setup.py clean sdist
  fades -d twine -x twine upload dist/fades-*


How to create a .deb
--------------------

Create the tarball:

  rm -rf build dist
  ./setup.py clean sdist


Copy this tarball to a clean dir, renaming as "orig"

  mkdir /tmp/fades_pack
  cp dist/fades-X.Y.tar.gz /tmp/fades_pack/fades_X.Y.orig.tar.gz
  cd /tmp/fades_pack


Most of next instructions come from http://wiki.debian.org/Python/GitPackaging

  tar -xf fades_X.Y.orig.tar.gz
  cd fades-X.Y
  git init
  git add .
  git commit -m "import fades_X.Y.orig.tar.gz"
  git checkout -b upstream
  pristine-tar commit ../fades_X.Y.orig.tar.gz upstream
  git-dpm init ../fades_X.Y.orig.tar.gz


Copy the project's debian dir and change changelog (be sure that this
"debian" dir is properly updated in the project... notably, be sure
copyright year is current one and also that no new dependencies were
introduced since last release).

  cp -pr $DEVEL/fades/pkg/debian .
  dch   # doing the following:
    - version should be   (X.Y-1) unstable
    - just leave one "* Initial release."


Continue with preparations:

  git add debian/*
  git commit -m "Added debian dir."
  git-dpm prepare
  git-dpm status


Build the .deb

  debuild -us -uc -I -i


To test the .deb you just created:

  sudo dpkg -i *.deb


If you want to uninstall it do:

    sudo dpkg -r fades


How to release it to Debian
---------------------------

Need just to report a bug very similar to this one:  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=814913

For that, just run the following and answer the questions:

    reportbug -B debian

(I had to do that twice, not sure why: first time it asked some questions and then errored out, second time it picked up from there and finish the job)


How to release it to Arch
-------------------------


Changes should be applied in the AUR repo ``ssh://aur@aur.archlinux.org/fades.git``

Edit ``pkg/archlinux/PKGBUILD`` and set *pkgver* and *sha256sums*, then run
``makepkg --printsrcinfo > .SRCINFO`` to update the .SRCINFO file.

Finally commit and push the changes. The package will be automatically updated in AUR.

``https://aur.archlinux.org/packages/fades``


How to release it to the Snap store
-----------------------------------

Edit the snapcraft yaml and change the "version" number

    vi pkg/snap/snapcraft.yaml

Build the snap (no need to specify the YAML, there is a hidden symlink to it):

    snapcraft

Push it to the store and release:

    snapcraft push fades_6.0_amd64.snap
    snapcraft release fades <revno just pushed> edge beta

Test it:

    sudo snap install fades --channel=beta --classic
    /snap/fades/current/bin/fades -V

If all is fine, release it to candidate:

    snapcraft release fades <revno just pushed> candidate

Announce internally: telegram, fades mail list.

Wait 3 days or so, and release to stable:

    snapcraft release fades <revno just pushed> stable

Announce in the snapcraft forum, something similar to:

    https://forum.snapcraft.io/t/call-for-testing-fades-7/5070


How to sign the files
---------------------

If you are putting files to download (notably, installators: .deb,
tarballs, etc) it's a good idea to sign them and offer checksums, in
case of somebody wanting to validate the files.

To sign it:

    gpg --armor --sign --detach-sig FILENAME

To create the checksum:

    sha1sum FILENAME > FILENAME.sha1


Final steps
-----------

- Remember to update the .deb and .tar.gz in www.taniquetil.com.ar/fades

- Create a change log and send press releases:
    - a tweet,
    - PyAr mail list, IRC and Telegram group
    - fades' Telegram group and mail list
    - python-announces
