From 4dd63270e17752349ebbcf78367daf426218022a Mon Sep 17 00:00:00 2001
From: Brent Huisman <brenthuisman@users.noreply.github.com>
Date: Mon, 13 Dec 2021 09:50:25 +0100
Subject: [PATCH] Add Release procedure to docs (#1738)

---
 doc/contrib/release.rst | 101 ++++++++++++++++++++++++++++++++++++++++
 doc/index.rst           |   1 +
 2 files changed, 102 insertions(+)
 create mode 100644 doc/contrib/release.rst

diff --git a/doc/contrib/release.rst b/doc/contrib/release.rst
new file mode 100644
index 00000000..345f33e5
--- /dev/null
+++ b/doc/contrib/release.rst
@@ -0,0 +1,101 @@
+Release Process
+===============
+
+These notes enumerate the steps required every time we release a new
+version of Arbor.
+
+Pre-release
+-----------
+
+Update tags/versions and test
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+1. Create new temp-branch ending in ``-rc``. E.g. ``v0.5.1-rc``
+2. Bump the ``VERSION`` file:
+   https://github.com/arbor-sim/arbor/blob/master/VERSION
+3. Update Python/pip/PyPi metadata and scripts
+
+   - Update MANIFEST (required for PyPi step later):
+     https://github.com/arbor-sim/arbor/blob/master/MANIFEST.in
+   - also checkout ``setup.cfg`` and ``setup.py``
+
+4. Double check all examples/tutorials/etc not covered by CI
+
+Manual test (deprecated)
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+5.  python setup.py sdist
+6.  python -m venv env
+7.  source env/bin/activate
+8.  move tarball here and extract
+9.  pip install –upgrade pip
+10. pip install numpy
+11. pip install ./arbor-0.5.1 –verbose
+12. python -c ’import arbor; print(arbor.__config__)’
+13. twine upload -r testpypi dist/\* (have some testrepo)
+14. create *another* venv: python -m venv env && source env/bin/activate
+15. pip install numpy
+16. pip install -i https://test.pypi.org/simple/ arbor==0.5.1 –verbose
+17. python -c ’import arbor; print(arbor.__config__)’
+
+Ciwheel/automated test (replaces manual test)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+5. Create/overwrite ``ciwheel`` branch with the above branch, and push
+   to Github.
+6. Collect artifact from GA run.
+7. twine upload -r testpypi dist/\*
+8. Ask users to test the above, e.g.:
+
+.. code-block:: bash
+
+   python -m venv env && source env/bin/activate
+   pip install numpy pip install -i https://test.pypi.org/simple/ arbor==0.5.1
+   python -c ’import arbor; print(arbor.__config__)’
+
+Release
+-------
+
+0. Make sure ciwheel passes tests, produced working wheels. Make sure
+   tests on master also passed, and master == ciwheel
+1. Tag and release: https://github.com/arbor-sim/arbor/releases
+
+   -  on cmdline: git tag -a TAGNAME
+   -  git push origin TAGNAME
+   -  Go to `GH tags`_ and click “…” and “Create release”
+   -  Go through merged PRs to come up with a changelog
+
+2. Create tarball with
+   ``scripts/create_tarball ~/loc/of/arbor tagname outputfile``
+
+   -  eg ``scripts/create_tarball /full/path/to/arbor v0.5.1 ~/arbor-v0.5.1-full.tar.gz``
+
+3. [`AUTOMATED`_] push to git@gitlab.ebrains.eu:arbor-sim/arbor.git
+4. Download output of wheel action and extract (verify the wheels and
+   source targz is in /dist)
+5. Verify wheel
+
+   -  create venv: python -m venv env && source env/bin/activate
+   -  pip install arbor-0.5.1-cp39-cp39-manylinux2014_x86_64.whl
+   -  python -c ’import arbor; print(arbor.__config__)’
+
+6. Upload to pypi
+
+   -  twine upload -r arborpypi dist/\*
+
+7. Verify
+
+   -  create venv: python -m venv env && source env/bin/activate
+   -  pip install arbor==0.5.1 –verbose
+   -  python -c ’import arbor; print(arbor.__config__)’
+
+Post release
+------------
+
+1. Update spack package
+
+   -  first, update ``spack/package.py``. The checksum of the targz is the sha256sum.
+   -  Then, use the file to `make PR here <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/>`_
+
+.. _GH tags: https://github.com/arbor-sim/arbor/tags
+.. _AUTOMATED: https://github.com/arbor-sim/arbor/blob/master/.github/workflows/ebrains.yml 
diff --git a/doc/index.rst b/doc/index.rst
index f396581b..9cfaa697 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -165,6 +165,7 @@ A full list of our software attributions can be found `here <https://github.com/
    contrib/doc
    contrib/example
    contrib/test
+   contrib/release
 
 .. meta::
    :google-site-verification: KbkW8d9MLsBFZz8Ry0tfcQRkHsgxzkECCahcyRSjWDo
-- 
GitLab