|
| 1 | +.. _making_a_release: |
| 2 | + |
| 3 | +================ |
| 4 | +Making a release |
| 5 | +================ |
| 6 | + |
| 7 | +A core developer should use the following steps to create a release `X.Y.Z` of |
| 8 | +**ninja-python-distributions** on `PyPI`_. |
| 9 | + |
| 10 | +This is usually done after :ref:`updating_castxml_version`. |
| 11 | + |
| 12 | +------------- |
| 13 | +Prerequisites |
| 14 | +------------- |
| 15 | + |
| 16 | +* All CI tests are passing on `AppVeyor`_, `CircleCI`_ and `Travis CI`_. |
| 17 | + |
| 18 | +* You have a `GPG signing key <https://help.github.com/articles/generating-a-new-gpg-key/>`_. |
| 19 | + |
| 20 | +------------------------- |
| 21 | +Documentation conventions |
| 22 | +------------------------- |
| 23 | + |
| 24 | +The commands reported below should be evaluated in the same terminal session. |
| 25 | + |
| 26 | +Commands to evaluate starts with a dollar sign. For example:: |
| 27 | + |
| 28 | + $ echo "Hello" |
| 29 | + Hello |
| 30 | + |
| 31 | +means that ``echo "Hello"`` should be copied and evaluated in the terminal. |
| 32 | + |
| 33 | + |
| 34 | +--------------------- |
| 35 | +`PyPI`_: Step-by-step |
| 36 | +--------------------- |
| 37 | + |
| 38 | +1. Make sure that all CI tests are passing on `AppVeyor`_, `CircleCI`_ and `Travis CI`_. |
| 39 | + |
| 40 | + |
| 41 | +2. Download the latest sources |
| 42 | + |
| 43 | + .. code:: |
| 44 | +
|
| 45 | + $ cd /tmp && \ |
| 46 | + git clone [email protected]:CastXML/CastXML-python-distributions CastXML-python-distributions-release && \ |
| 47 | + cd CastXML-python-distributions-release |
| 48 | +
|
| 49 | +3. List all tags sorted by version |
| 50 | + |
| 51 | + .. code:: |
| 52 | +
|
| 53 | + $ git fetch --tags && \ |
| 54 | + git tag -l | sort -V |
| 55 | +
|
| 56 | +
|
| 57 | +4. Choose the next release version number |
| 58 | + |
| 59 | + .. code:: |
| 60 | +
|
| 61 | + $ release=X.Y.Z |
| 62 | +
|
| 63 | + .. warning:: |
| 64 | + |
| 65 | + To ensure the packages are uploaded on `PyPI`_, tags must match this regular |
| 66 | + expression: ``^[0-9]+(\.[0-9]+)*(\.post[0-9]+)?$``. |
| 67 | + |
| 68 | + |
| 69 | +5. In `README.md`, update `PyPI`_ download count after running ``pypistats overall CastXML`` |
| 70 | + and commit the changes. |
| 71 | + |
| 72 | + .. code:: |
| 73 | +
|
| 74 | + $ git add README.rst && \ |
| 75 | + git commit -m "README: Update download stats" |
| 76 | +
|
| 77 | + .. note:: |
| 78 | + |
| 79 | + To learn more about `pypistats`, see https://pypi.org/project/pypistats/ |
| 80 | + |
| 81 | + |
| 82 | +6. Tag the release |
| 83 | + |
| 84 | + .. code:: |
| 85 | +
|
| 86 | + $ git tag --sign -m "CastXML-python-distributions ${release}" ${release} master |
| 87 | +
|
| 88 | + .. warning:: |
| 89 | + |
| 90 | + We recommend using a `GPG signing key <https://help.github.com/articles/generating-a-new-gpg-key/>`_ |
| 91 | + to sign the tag. |
| 92 | + |
| 93 | + |
| 94 | +7. Publish the release tag |
| 95 | + |
| 96 | + .. code:: |
| 97 | +
|
| 98 | + $ git push origin ${release} |
| 99 | +
|
| 100 | + .. note:: This will trigger builds on each CI services and automatically upload the wheels \ |
| 101 | + and source distribution on `PyPI`_. |
| 102 | + |
| 103 | +8. Check the status of the builds on `AppVeyor`_, `CircleCI`_ and `Travis CI`_. |
| 104 | + |
| 105 | +9. Once the builds are completed, check that the distributions are available on `PyPI`_. |
| 106 | + |
| 107 | +10. Create a clean testing environment to test the installation |
| 108 | + |
| 109 | + .. code:: |
| 110 | +
|
| 111 | + $ pushd $(mktemp -d) && \ |
| 112 | + mkvirtualenv CastXML-${release}-install-test && \ |
| 113 | + pip install CastXML && \ |
| 114 | + castxml --version |
| 115 | +
|
| 116 | + .. note:: |
| 117 | + |
| 118 | + If the ``mkvirtualenv`` command is not available, this means you do not have `virtualenvwrapper`_ |
| 119 | + installed, in that case, you could either install it or directly use `virtualenv`_ or `venv`_. |
| 120 | + |
| 121 | +11. Cleanup |
| 122 | + |
| 123 | + .. code:: |
| 124 | +
|
| 125 | + $ popd && \ |
| 126 | + deactivate && \ |
| 127 | + rm -rf dist/* && \ |
| 128 | + rmvirtualenv CastXML-${release}-install-test |
| 129 | +
|
| 130 | +12. Publish master branch |
| 131 | + |
| 132 | + .. code:: |
| 133 | +
|
| 134 | + $ git push origin master |
| 135 | +
|
| 136 | +.. _virtualenvwrapper: https://virtualenvwrapper.readthedocs.io/ |
| 137 | +.. _virtualenv: http://virtualenv.readthedocs.io |
| 138 | +.. _venv: https://docs.python.org/3/library/venv.html |
| 139 | + |
| 140 | + |
| 141 | +.. _AppVeyor: https://ci.appveyor.com/project/CastXML/CastXML-python-distributions/history |
| 142 | +.. _CircleCI: https://circleci.com/gh/CastXML/CastXML-python-distributions |
| 143 | +.. _Travis CI: https://travis-ci.org/CastXML/CastXML-python-distributions/pull_requests |
| 144 | + |
| 145 | +.. _PyPI: https://pypi.org/project/CastXML |
0 commit comments