From 93c5de070d2bde6141342f8cc18f98ff846ddd63 Mon Sep 17 00:00:00 2001
From: Brent Huisman <brenthuisman@users.noreply.github.com>
Date: Tue, 19 Jul 2022 16:06:15 +0200
Subject: [PATCH] bump to 0.7 (#1923)

- Generate timestamped VERSION once, to properly group on Test.PyPI. Example:
  - https://github.com/arbor-sim/arbor/actions/runs/2696804929
  - https://test.pypi.org/project/arbor/0.7rc20220719101015/
- Update/simplify release documentation.
- Update to v0.7
---
 .github/workflows/ciwheel.yml | 50 ++++++++++++++++++++++++++++-------
 CONTRIBUTING.md               |  3 +--
 README.md                     | 11 ++++----
 VERSION                       |  2 +-
 doc/contrib/release.rst       | 32 +++++++++++-----------
 doc/index.rst                 | 14 +++++++---
 pyproject.toml                |  2 +-
 python/readme.md              | 10 -------
 python/readme.rst             | 13 +++++++++
 9 files changed, 89 insertions(+), 48 deletions(-)
 delete mode 100644 python/readme.md
 create mode 100644 python/readme.rst

diff --git a/.github/workflows/ciwheel.yml b/.github/workflows/ciwheel.yml
index 51a3408b..567882b8 100644
--- a/.github/workflows/ciwheel.yml
+++ b/.github/workflows/ciwheel.yml
@@ -1,10 +1,10 @@
+
 name: Arbor on Wheels
 
 on:
   push:
     branches: 
       - ciwheel
-      - v*rc
     tags:
       - v*
 
@@ -12,21 +12,46 @@ on:
     - cron: '0 2 * * 0' # run at 2 AM every sunday
 
 jobs:
+  get_timestamp:
+    name: Prep VERSION
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Get Arbor
+        uses: actions/checkout@v2
+        with:
+          fetch-depth: 0
+          submodules: recursive
+      - name: Create unique VERSION
+        if: endsWith(github.ref,'ciwheel')
+        run: python3 -c 'import time;f=open("VERSION","r+");content = f.readlines();f.seek(0);f.write(content[0].strip()+time.strftime("%Y%m%d%H%I%S"))'
+      - uses: actions/upload-artifact@v3
+        with:
+            name: arbver
+            path: ${{ github.workspace }}/VERSION
+
   build_binary_wheels:
     name: Build wheels on ${{ matrix.os }}
+    needs: get_timestamp
     runs-on: ${{ matrix.os }}
     strategy:
       matrix:
         os: [ubuntu-latest, macos-latest]
 
     steps:
-      - uses: actions/checkout@v2
+      - name: Get Arbor
+        uses: actions/checkout@v2
         with:
           fetch-depth: 0
           submodules: recursive
-      - name: Create unique VERSION
-        if: endsWith(github.ref,'ciwheel') || endsWith(github.ref,'rc') # https://docs.github.com/en/actions/learn-github-actions/expressions
-        run: python3 -c 'import time;f=open("VERSION","r+");content = f.readlines();f.seek(0);f.write(content[0].strip()+time.strftime("%Y%m%d%H%I%S"))'
+      - name: Delete VERSION
+        run: rm -f VERSION
+      - name: Get VERSION
+        uses: actions/download-artifact@v3
+        with:
+          name: arbver
+      - name: Check VERSION
+        run: cat VERSION
       - name: Install cibuildwheel
         run: python3 -m pip install cibuildwheel
       - name: Build wheels
@@ -38,6 +63,7 @@ jobs:
 
   build_sdist:
     name: Build sdist
+    needs: get_timestamp
     runs-on: ubuntu-latest
 
     steps:
@@ -45,13 +71,19 @@ jobs:
         uses: actions/setup-python@v2
       - name: Get packages
         run: python3 -m pip install build
-      - uses: actions/checkout@v2
+      - name: Get Arbor
+        uses: actions/checkout@v2
         with:
           fetch-depth: 0
           submodules: recursive
-      - name: Create unique VERSION
-        if: endsWith(github.ref,'ciwheel') || endsWith(github.ref,'rc') # https://docs.github.com/en/actions/learn-github-actions/expressions
-        run: python3 -c 'import time;f=open("VERSION","r+");content = f.readlines();f.seek(0);f.write(content[0].strip()+time.strftime("%Y%m%d%H%I%S"))'
+      - name: Delete VERSION
+        run: rm -f VERSION
+      - name: Get VERSION
+        uses: actions/download-artifact@v3
+        with:
+          name: arbver
+      - name: Check VERSION
+        run: cat VERSION
       - name: Make sdist
         run: python3 -m build -s
       - name: Install sdist
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 3be4b679..aa7c38b1 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -15,6 +15,5 @@ where we have laid out how you can go about making your contribution.
 
 You can reach out in the following ways:
 
-* [Discussions](https://github.com/arbor-sim/arbor/discussions). We encourage you to use the discussion board for help with modelling. Any other questions or remarks regarding using Arbor for your research are of course also welcome.
-* [Gitter](https://gitter.im/arbor-sim/community). If you're interested in developing Arbor itself, get in touch on Gitter.
+* [Gitter](https://gitter.im/arbor-sim/community) and [Matrix](https://matrix.to/#/#arbor-sim_community:gitter.im). We encourage you to use the discussion board for help with modelling. Any other questions or remarks regarding using Arbor for your research are of course also welcome.
 * [Email](mailto:contact@arbor-sim.org).
diff --git a/README.md b/README.md
index 31bcc7c5..7b3eca78 100644
--- a/README.md
+++ b/README.md
@@ -1,16 +1,17 @@
-[![hpc ci](https://gitlab.com/cscs-ci/arbor-sim/arbor/badges/master/pipeline.svg)](https://gitlab.com/cscs-ci/arbor-sim/arbor/-/commits/master)
-[![basic ci](https://github.com/arbor-sim/arbor/actions/workflows/basic.yml/badge.svg)](https://github.com/arbor-sim/arbor/actions/workflows/test-everything.yml)
+[![ci](https://github.com/arbor-sim/arbor/actions/workflows/test-everything.yml/badge.svg)](https://github.com/arbor-sim/arbor/actions/workflows/test-everything.yml)
+[![hpcci](https://gitlab.com/cscs-ci/arbor-sim/arbor/badges/master/pipeline.svg)](https://gitlab.com/cscs-ci/arbor-sim/arbor/-/commits/master)
+[![pythonwheels](https://github.com/arbor-sim/arbor/actions/workflows/ciwheel.yml/badge.svg)](https://github.com/arbor-sim/arbor/actions/workflows/ciwheel.yml)
 [![gitpod](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/arbor-sim/arbor)
 [![docs](https://readthedocs.org/projects/arbor/badge/?version=latest)](https://docs.arbor-sim.org/en/latest/)
-[![Gitter](https://badges.gitter.im/arbor-sim/community.svg)](https://gitter.im/arbor-sim/community)
+[![gitter](https://badges.gitter.im/arbor-sim/community.svg)](https://gitter.im/arbor-sim/community)
 
 # Arbor Library
 
 [Arbor](https://arbor-sim.org) is a library for implementing performance portable network simulations of multi-compartment neuron models.
 
-An installation guide and library documentation are available online at [Read the Docs](http://arbor.readthedocs.io/en/latest/).
+An installation guide and library documentation are available online at [docs.arbor-sim.org](http://docs.arbor-sim.org).
 
-[Submit a ticket or start a discussion](https://github.com/arbor-sim/arbor) if you have any questions or want help.
+[Submit a ticket](https://github.com/arbor-sim/arbor/issues) or [join Gitter](https://gitter.im/arbor-sim/community) or [Matrix](https://matrix.to/#/#arbor-sim_community:gitter.im) if you have any questions or need help.
 
 ### Citing Arbor
 
diff --git a/VERSION b/VERSION
index 2feed2fe..eb49d7c7 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.6.1-dev
+0.7
diff --git a/doc/contrib/release.rst b/doc/contrib/release.rst
index 4962193e..bd354a03 100644
--- a/doc/contrib/release.rst
+++ b/doc/contrib/release.rst
@@ -53,8 +53,11 @@ Update tags/versions and test
 
 #. Run all tests.
 
-   - ``ciwheel.yml`` triggers when you push a branch called ``v*rc``, ON YOUR OWN REPO (so check ``github.com/$yourname/arbor/actions``). Make sure the tests pass.
-   - ``ciwheel.yml`` pushes automatically to `Test.PyPI.org <https://test.pypi.org/project/arbor/>`_. Test (consider asking other OS-users):
+   - ``ciwheel.yml`` triggers when you push a branch called ``ciwheel``, and on new Git tags. Since we've not tagged the release yet, run ``git push origin HEAD:ciwheel``. Make sure the tests pass.
+   
+      - ``ciwheel.yml`` pushes automatically to `Test.PyPI.org <https://test.pypi.org/project/arbor/>`_. This only passes if ran as branch of the main ``arbor-sim`` repo (as that's where the PyPI secret lives). On your own repo, the upload will fail (the rest should pass). If you want to test uploading, then force push to the _upstream_ ``ciwheel`` branch, e.g. ``git push upstream HEAD:ciwheel --force``.
+   
+   - If you want to test the PyPI submission (consider asking other OS-users):
 
      .. code-block:: bash
 
@@ -64,37 +67,34 @@ Update tags/versions and test
         python -c 'import arbor; print(arbor.__config__)'
 
    - Use build flags to test the source package: :ref:`in_python_adv`
-   - In case you want to manually want to trigger ``ciwheel.yml`` GA, overwrite the ``ciwheel`` branch with the commit of your choosing and force push to Github.
 
 Release
 -------
 
-#. Make sure ``ciwheel.yml`` passed all tests, produced working wheels, were installable from `Test.PyPI.org <https://test.pypi.org/project/arbor/>`_ and that no problems were reported.
+#. Make sure no errors were encountered in the pre-release phase, working wheels were produced, and were installable from `Test.PyPI.org <https://test.pypi.org/project/arbor/>`_ and that no problems were reported.
    
 #. Change ``VERSION``. Make sure does not end with ``-rc`` or ``-dev``.
 
+#. Tag
+
+   - commit and open a PR for the above changes.
+   - on cmdline: ``git tag -a TAGNAME``
+   - ``git push upstream TAGNAME``
+
 #. 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``
    
-#. Update ``spack/package.py``. The checksum of the targz is the sha256sum.
-
-#. Start a new release on Zenodo, this allocated a DOI, but you don't have to finish it right away. Add new Zenodo badge/link to docs/README.
-
-#. Tag
-
-   - commit the above changes.
-   - on cmdline: git tag -a TAGNAME
-   - git push upstream TAGNAME
-
-#. [`AUTOMATED`_] push to git@gitlab.ebrains.eu:arbor-sim/arbor.git
-
 #. Download output of wheel action associated to this release commit and extract (verify the wheels and
    source targz is in /dist)
 
    - Of course, the above action must have passed the tests successfully.
    
+#. Update ``spack/package.py``. The checksum of the targz is the sha256sum.
+
+#. Start a new release on Zenodo, this allocated a DOI, but you don't have to finish it right away. Add new Zenodo badge/link to docs/README.
+
 #. Create Github Release: https://github.com/arbor-sim/arbor/releases
 
    - Go to `GH tags`_ and click “…” and “Create release”
diff --git a/doc/index.rst b/doc/index.rst
index 6c2f7a2b..5fdb1bb0 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -1,11 +1,17 @@
 Arbor
 =====
 
-|testbadge| |zlatest| |gitter|
+|ci| |hpcci| |pythonwheels| |zlatest| |gitter|
 
-.. |testbadge| image:: https://github.com/arbor-sim/arbor/actions/workflows/test-everything.yml/badge.svg
+.. |ci| image:: https://github.com/arbor-sim/arbor/actions/workflows/test-everything.yml/badge.svg
     :target: https://github.com/arbor-sim/arbor/actions/workflows/test-everything.yml
 
+.. |hpcci| image:: https://gitlab.com/cscs-ci/arbor-sim/arbor/badges/master/pipeline.svg
+    :target: https://gitlab.com/cscs-ci/arbor-sim/arbor/-/commits/master
+
+.. |pythonwheels| image:: https://github.com/arbor-sim/arbor/actions/workflows/ciwheel.yml/badge.svg
+    :target: https://github.com/arbor-sim/arbor/actions/workflows/ciwheel.yml
+
 .. |gitter| image:: https://badges.gitter.im/arbor-sim/community.svg
     :target: https://gitter.im/arbor-sim/community
 
@@ -30,9 +36,9 @@ Documentation organisation
 
 * :ref:`tutorial` contains a few ready-made examples you can use to quickly get started using Arbor. In the tutorial descriptions we link to the relevant Arbor concepts.
 * :ref:`modelintro` describes the design and concepts used in Arbor. The breakdown of concepts is mirrored (as much as possible) in the :ref:`pyoverview` and :ref:`cppoverview`, so you can easily switch between languages and concepts.
-* The API section details our :ref:`pyoverview` and :ref:`cppoverview` API. :ref:`dev-overview` describes Arbor code that is not user-facing; convenience classes, architecture abstractions, and other information that is relevant to understanding the inner workings of Arbor and the mathematical foundations underpinning the engine.
+* The API section details our :ref:`pyoverview` and :ref:`cppoverview` API. The :ref:`dev-overview` describes Arbor code that is not user-facing; convenience classes, architecture abstractions, and other information that is relevant to understanding the inner workings of Arbor and the mathematical foundations underpinning the engine.
 * :ref:`modelling-overview` is a collection of best practices and experiences collected from the Arbor modelling community, meant to spread information on how to solve common modelling questions in Arbor.
-* Contributions to Arbor are very welcome! Under :ref:`contribindex` describe conventions and procedures for all kinds of contributions.
+* Contributions to Arbor are very welcome! Under :ref:`contribindex` you'll find the conventions and procedures for all kinds of contributions.
 
 Citing Arbor
 ------------
diff --git a/pyproject.toml b/pyproject.toml
index 745f7471..0d732541 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -31,7 +31,7 @@ py-modules = ["arbor"]
 
 [tool.setuptools.dynamic]
 version = {file = ["VERSION"]}
-readme = {file = ["python/readme.md"]}
+readme = {file = ["python/readme.rst"]}
 
 [project.urls]
 homepage = "https://arbor-sim.org"
diff --git a/python/readme.md b/python/readme.md
deleted file mode 100644
index cfa7ddda..00000000
--- a/python/readme.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# Arbor
-
-The Arbor Python package is a wrapper around the high-performance C++ library Arbor, for
-constructing and running simulations multi-compartment neuron models, from single cell models
-to large networks.
-
-Documentation is available online at [Read the Docs](https://docs.arbor-sim.org/en/latest/python).
-
-[Submit a ticket](https://github.com/arbor-sim/arbor) if you have any questions or want help.
-
diff --git a/python/readme.rst b/python/readme.rst
new file mode 100644
index 00000000..43ffa5de
--- /dev/null
+++ b/python/readme.rst
@@ -0,0 +1,13 @@
+Arbor
+=====
+
+The Arbor Python package is a wrapper around the high-performance C++
+library Arbor, for constructing and running simulations
+multi-compartment neuron models, from single cell models to large
+networks.
+
+Documentation is available online at `Read the
+Docs <https://docs.arbor-sim.org/en/latest/python>`__.
+
+`Submit a ticket <https://github.com/arbor-sim/arbor>`__ if you have any
+questions or want help.
-- 
GitLab