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