|
| 1 | +Create a release |
| 2 | +================ |
| 3 | + |
| 4 | +Preparing a release |
| 5 | ++++++++++++++++++++ |
| 6 | + |
| 7 | +The ``release:prepare`` nox session affects files in the ``doc/changes`` directory: |
| 8 | + |
| 9 | +* Creates & switches to a release branch (can be skipped with ``--no-branch``) |
| 10 | +* Updates the version in the ``pyproject.toml`` |
| 11 | +* Moves the content of unreleased changes file ``unreleased.md`` to a versioned changes file ``changes_<version>.md`` |
| 12 | +* Appends to the versioned changes file any direct dependency changes between the current ``poetry.lock`` and the one from the latest tag |
| 13 | +* Updates the ``changelog.md`` list with the newly create versioned changes file |
| 14 | +* Commits the changes (can be skipped with ``--no-add``) |
| 15 | +* Pushes the changes and creates a PR (can be deactivated with ``--no-pr``) |
| 16 | + |
| 17 | +After a PR is created, approved, & merged into the default branch. A developer can use |
| 18 | +the ``release:trigger`` nox session which: |
| 19 | + |
| 20 | +* Switches & pulls the changes from the default branch |
| 21 | +* Verifies that the version to be released does not already have a git tag or GitHub release |
| 22 | +* Creates a new tag & pushes it to the default branch, which will trigger the GitHub workflow ``cd.yml`` |
| 23 | + |
| 24 | +Simple instructions |
| 25 | +------------------- |
| 26 | + |
| 27 | +The ``release:trigger`` nox session |
| 28 | + |
| 29 | + |
| 30 | +#. Prepare the project for a new release: |
| 31 | + |
| 32 | + .. code-block:: shell |
| 33 | +
|
| 34 | + nox -s release:prepare -- --type {major,minor,patch} |
| 35 | +
|
| 36 | +#. Merge your **Pull Request** to the **default branch** |
| 37 | + |
| 38 | +#. Trigger the release: |
| 39 | + |
| 40 | + .. code-block:: shell |
| 41 | +
|
| 42 | + nox -s release:trigger |
| 43 | +
|
| 44 | +
|
| 45 | +What to do if the release failed? |
| 46 | ++++++++++++++++++++++++++++++++++ |
| 47 | + |
| 48 | +The release failed during pre-release checks |
| 49 | +-------------------------------------------- |
| 50 | + |
| 51 | +#. Delete the local tag |
| 52 | + |
| 53 | + .. code-block:: shell |
| 54 | +
|
| 55 | + git tag -d "<major>.<minor>.<patch>"" |
| 56 | +
|
| 57 | +#. Delete the remote tag |
| 58 | +
|
| 59 | + .. code-block:: shell |
| 60 | +
|
| 61 | + git push --delete origin "<major>.<minor>.<patch>" |
| 62 | +
|
| 63 | +#. Fix the issue(s) which led to the failing checks |
| 64 | +#. Start the release process from the beginning |
| 65 | +
|
| 66 | +
|
| 67 | +One of the release steps failed (Partial Release) |
| 68 | +------------------------------------------------- |
| 69 | +#. Check the GitHub action/workflow to see which steps failed |
| 70 | +#. Finish or redo the failed release steps manually |
| 71 | +
|
| 72 | +.. note:: Example |
| 73 | +
|
| 74 | + **Scenario**: Publishing of the release on GitHub was successfully but during the PyPi release, the upload step was interrupted. |
| 75 | +
|
| 76 | + **Solution**: Manually push the package to PyPi |
0 commit comments