| 1 |
.. _create-new-release: |
| 2 |
|
| 3 |
Create new Modules release |
| 4 |
========================== |
| 5 |
|
| 6 |
This document is a guide to draft then publish a new release of Modules. It |
| 7 |
provides all the information from building the distribution tarballs to |
| 8 |
updating external resources providing Modules. |
| 9 |
|
| 10 |
Versioning policy |
| 11 |
----------------- |
| 12 |
|
| 13 |
Modules project follows `Semantic Versioning 2.0.0`_. Version number has the |
| 14 |
``MAJOR.MINOR.PATCH`` form. For a new release, increment the: |
| 15 |
|
| 16 |
* ``MAJOR`` when you make incompatible changes |
| 17 |
* ``MINOR`` when you add backward-compatible features |
| 18 |
* ``PATCH`` when you add backward-compatible bug fixes |
| 19 |
|
| 20 |
.. _Semantic Versioning 2.0.0: https://semver.org/ |
| 21 |
|
| 22 |
Release commit |
| 23 |
-------------- |
| 24 |
|
| 25 |
At this point, all changes visible by user for this release should be |
| 26 |
described in :file:`NEWS.rst` and :file:`doc/source/changes.rst`. Prominent |
| 27 |
new features should be described with examples in :file:`MIGRATING.rst`. |
| 28 |
|
| 29 |
Finalize release content: |
| 30 |
|
| 31 |
* Update version number in :file:`version.inc.in` and |
| 32 |
:file:`doc/source/conf.py` |
| 33 |
* Set release date in :file:`NEWS.rst` and :file:`MIGRATING.rst` |
| 34 |
* Update version number and draft changelog message in |
| 35 |
:file:`share/rpm/environment-modules.spec.in` |
| 36 |
|
| 37 |
* Changelog should mention release author and date |
| 38 |
* Indicate that release version is updated |
| 39 |
* Describe any other changes made to the RPM spec file since last release |
| 40 |
|
| 41 |
* Update release date in any documentation file that demonstrates |
| 42 |
``module --version`` output. |
| 43 |
* If Modules Tcl extension library has been changed since last release, update |
| 44 |
the version number of this library in :file:`lib/configure.ac`. |
| 45 |
* Update table of supported versions in :file:`SECURITY.md`. |
| 46 |
|
| 47 |
Look at previous release commit, like :ghcommit:`3b68dee7`, to view the lines |
| 48 |
that should be modified and what content to write. |
| 49 |
|
| 50 |
Perform commit: |
| 51 |
|
| 52 |
.. code-block:: console |
| 53 |
|
| 54 |
version=$(grep ^MODULES_RELEASE version.inc.in | cut -d ' ' -f 3) |
| 55 |
git commit -a -m "Release of version $version" |
| 56 |
|
| 57 |
Tag version: |
| 58 |
|
| 59 |
.. code-block:: console |
| 60 |
|
| 61 |
git tag v$version |
| 62 |
|
| 63 |
Build and test release |
| 64 |
---------------------- |
| 65 |
|
| 66 |
The build and test of the new release is handled by the :file:`script/mrel` |
| 67 |
script. This utility creates the distribution archives, test these artifacts |
| 68 |
and push to personal repository to run CI. |
| 69 |
|
| 70 |
:file:`script/mrel` is made to be run on a Fedora system. It also build and |
| 71 |
test install of RPM package and run remote build on Koji infrastructure. |
| 72 |
|
| 73 |
:file:`script/mrel` asks when initializing for sudo rights (to remove local |
| 74 |
``module`` installations prior running build and test), and for a personal |
| 75 |
remote GitHub repository (to trigger online CI). |
| 76 |
|
| 77 |
.. code-block:: console |
| 78 |
|
| 79 |
script/mrel |
| 80 |
|
| 81 |
.. note:: As it tests the different artifacts through running the |
| 82 |
non-regression test suite, the execution of :file:`script/mrel` takes a lot |
| 83 |
of time (more than 1 hour). |
| 84 |
|
| 85 |
If script fails, its full output can be analyzed in :file:`mrel.out` log file. |
| 86 |
This log file may be removed if no error occurs: |
| 87 |
|
| 88 |
.. code-block:: console |
| 89 |
|
| 90 |
rm mrel.out |
| 91 |
|
| 92 |
Save a copy of the generated distribution files (adapt ``RELEASE_DIR`` to fit |
| 93 |
your local setup): |
| 94 |
|
| 95 |
.. code-block:: console |
| 96 |
|
| 97 |
RELEASE_DIR=~/devel/modules-releases |
| 98 |
cp modules-$version{.tar.bz2,.tar.gz,-win.zip} $RELEASE_DIR/ |
| 99 |
ls -lh $RELEASE_DIR/modules-$version{.tar.bz2,.tar.gz,-win.zip} |
| 100 |
|
| 101 |
Publish release |
| 102 |
--------------- |
| 103 |
|
| 104 |
Publication of the new release is handled by the :file:`script/mpub` script. |
| 105 |
This tool pushes to online repositories (GitHub and SourceForge) and update |
| 106 |
website (also pushed to both platforms). |
| 107 |
|
| 108 |
:file:`script/mpub` asks when initializing for upstream remote GitHub |
| 109 |
repository and it expects that valid credential to connect to SourceForge via |
| 110 |
SFTP is available. |
| 111 |
|
| 112 |
.. code-block:: console |
| 113 |
|
| 114 |
script/mpub |
| 115 |
|
| 116 |
If script fails, its full output can be analyzed in :file:`mpub.out` log file. |
| 117 |
This log file may be removed if no error occurs: |
| 118 |
|
| 119 |
.. code-block:: console |
| 120 |
|
| 121 |
rm mpub.out |
| 122 |
|
| 123 |
Now the website should mention the new release on the *Download* link. Stable |
| 124 |
target of online document should also point to the new release. It may be |
| 125 |
verified at: |
| 126 |
|
| 127 |
* https://envmodules.io |
| 128 |
* https://modules.readthedocs.io/en/stable/NEWS.html |
| 129 |
|
| 130 |
Change *Default Download* on `SourceForge Files`_ page. Set the ``.tar.gz`` |
| 131 |
dist ball of the new release as the new default. |
| 132 |
|
| 133 |
.. _SourceForge Files: https://sourceforge.net/projects/modules/files/Modules/ |
| 134 |
|
| 135 |
Close milestone on GitHub at https://github.com/envmodules/modules/milestones |
| 136 |
|
| 137 |
Create release on GitHub at https://github.com/envmodules/modules/releases/new: |
| 138 |
|
| 139 |
* Release title is bare version number ``X.Y.Z`` |
| 140 |
* Attach ``.tar.gz``, ``.tar.bz2`` and ``-win.zip`` artifacts to the release |
| 141 |
* Build release description based on :file:`NEWS.rst` content: |
| 142 |
|
| 143 |
.. code-block:: console |
| 144 |
|
| 145 |
major_version=$(cut -d '.' -f 1 <<< "$version") |
| 146 |
minor_version=$(cut -d '.' -f 2 <<< "$version") |
| 147 |
previous_version="$major_version.$((minor_version - 1))" |
| 148 |
grep -B1000 ".. _$previous_version release notes:" NEWS.rst | grep -A1000 -- "--------------------------" >NEWS.new |
| 149 |
nb_lines=$(wc -l NEWS.new| cut -d ' ' -f 1) |
| 150 |
sed -i -e "1,2d;$((nb_lines-3)),\$d" NEWS.new |
| 151 |
sed -i -z -e "s/\n / /g" -e "s/\n / /g" -e 's/:option://g' -e 's/:mfcmd://g' -e 's/:subcmd://g' -e 's/:file://g' -e 's/:ref://g' -e 's/:mfcmd://g' -e 's/:mconfig://g' -e 's/:instopt://g' -e 's/:mfvar://g' -e 's/:envvar://g' -e 's/:command://g' -e 's/:sitevar://g' -e 's/``/`/g' NEWS.new |
| 152 |
|
| 153 |
Check resulting :file:`NEWS.new` to adapt RST code for boxes, links, codes |
| 154 |
(especially cleaning those containing ``\<`` or ``\>``) and make them valid |
| 155 |
MarkDown code. |
| 156 |
|
| 157 |
.. vim:set tabstop=2 shiftwidth=2 expandtab autoindent: |