|
1 |
| -===================== |
2 |
| -How to Make a Release |
3 |
| -===================== |
| 1 | +.. _making_a_release: |
4 | 2 |
|
5 |
| -A core developer should use the following steps to create a release of |
6 |
| -**ninja-python-distributions**. This is usually done after :ref:`updating_ninja_version`. |
| 3 | +================ |
| 4 | +Making a release |
| 5 | +================ |
7 | 6 |
|
8 |
| -1. Make sure that all CI tests are passing: `AppVeyor`_, `CircleCI`_ and `TravisCi`_. |
| 7 | +A core developer should use the following steps to create a release `X.Y.Z` of |
| 8 | +**ninja-python-distributions** on `PyPI`_. |
9 | 9 |
|
10 |
| -2. Tag the release. For version *X.Y.Z*:: |
| 10 | +This is usually done after :ref:`updating_ninja_version`. |
11 | 11 |
|
12 |
| - release=X.Y.Z |
13 |
| - git tag -s -m "ninja-python-distributions ${release}" ${release} origin/master |
| 12 | +------------- |
| 13 | +Prerequisites |
| 14 | +------------- |
14 | 15 |
|
15 |
| -3. Push the tag:: |
| 16 | +* All CI tests are passing on `AppVeyor`_, `CircleCI`_ and `Travis CI`_. |
16 | 17 |
|
17 |
| - git push origin ${release} |
| 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 | +Setting up environment |
| 35 | +---------------------- |
| 36 | + |
| 37 | +1. First, `register for an account on PyPI <https://pypi.org>`_. |
| 38 | + |
| 39 | + |
| 40 | +2. If not already the case, ask to be added as a ``Package Index Maintainer``. |
| 41 | + |
| 42 | + |
| 43 | +3. Create a ``~/.pypirc`` file with your login credentials:: |
| 44 | + |
| 45 | + [distutils] |
| 46 | + index-servers = |
| 47 | + pypi |
| 48 | + pypitest |
| 49 | + |
| 50 | + [pypi] |
| 51 | + username=<your-username> |
| 52 | + password=<your-password> |
| 53 | + |
| 54 | + [pypitest] |
| 55 | + repository=https://test.pypi.org/legacy/ |
| 56 | + username=<your-username> |
| 57 | + password=<your-password> |
| 58 | + |
| 59 | + where ``<your-username>`` and ``<your-password>`` correspond to your PyPI account. |
| 60 | + |
| 61 | + |
| 62 | +--------------------- |
| 63 | +`PyPI`_: Step-by-step |
| 64 | +--------------------- |
| 65 | + |
| 66 | +1. Make sure that all CI tests are passing on `AppVeyor`_, `CircleCI`_ and `Travis CI`_. |
| 67 | + |
| 68 | + |
| 69 | +2. Download the latest sources |
| 70 | + |
| 71 | + .. code:: |
| 72 | +
|
| 73 | + $ cd /tmp && \ |
| 74 | + git clone git@github.com:scikit-build/ninja-python-distributions ninja-python-distributions-release && \ |
| 75 | + cd ninja-python-distributions-release |
| 76 | +
|
| 77 | +3. List all tags sorted by version |
| 78 | + |
| 79 | + .. code:: |
| 80 | +
|
| 81 | + $ git fetch --tags && \ |
| 82 | + git tag -l | sort -V |
| 83 | +
|
| 84 | +
|
| 85 | +4. Choose the next release version number |
| 86 | + |
| 87 | + .. code:: |
| 88 | +
|
| 89 | + $ release=X.Y.Z |
| 90 | +
|
| 91 | + .. warning:: |
| 92 | + |
| 93 | + To ensure the packages are uploaded on `PyPI`_, tags must match this regular |
| 94 | + expression: ``^[0-9]+(\.[0-9]+)*(\.post[0-9]+)?$``. |
| 95 | + |
| 96 | + |
| 97 | +5. Tag the release |
| 98 | + |
| 99 | + .. code:: |
| 100 | +
|
| 101 | + $ git tag --sign -m "ninja-python-distributions ${release}" ${release} origin/master |
| 102 | +
|
| 103 | + .. warning:: |
| 104 | + |
| 105 | + We recommend using a `GPG signing key <https://help.github.com/articles/generating-a-new-gpg-key/>`_ |
| 106 | + to sign the tag. |
| 107 | + |
| 108 | + |
| 109 | +6. Publish the release tag |
| 110 | + |
| 111 | + .. code:: |
| 112 | +
|
| 113 | + $ git push origin ${release} |
18 | 114 |
|
19 | 115 | .. note:: This will trigger builds on each CI services and automatically upload the wheels \
|
20 | 116 | and source distribution on `PyPI`_.
|
21 | 117 |
|
22 |
| -4. Check the status of the builds on `AppVeyor`_, `CircleCI`_ and `TravisCi`_. |
| 118 | +7. Check the status of the builds on `AppVeyor`_, `CircleCI`_ and `TravisCi`_. |
| 119 | + |
| 120 | +8. Once the builds are completed, check that the distributions are available on `PyPI`_. |
| 121 | + |
| 122 | +9. Create a clean testing environment to test the installation |
| 123 | + |
| 124 | + .. code:: |
| 125 | +
|
| 126 | + $ mkvirtualenv ninja-${release}-install-test && \ |
| 127 | + pip install ninja && \ |
| 128 | + ninja --version |
| 129 | +
|
| 130 | + .. note:: |
| 131 | + |
| 132 | + If the ``mkvirtualenv`` command is not available, this means you do not have `virtualenvwrapper`_ |
| 133 | + installed, in that case, you could either install it or directly use `virtualenv`_ or `venv`_. |
| 134 | + |
| 135 | +10. Cleanup |
| 136 | + |
| 137 | + .. code:: |
23 | 138 |
|
24 |
| -5. Once the builds are completed, check that the distributions are available on `PyPI`_. |
| 139 | + $ deactivate && \ |
| 140 | + rm -rf dist/* && \ |
| 141 | + rmvirtualenv ninja-${release}-install-test |
25 | 142 |
|
26 |
| -6. Finally, make sure the package can be installed:: |
27 | 143 |
|
28 |
| - mkvirtualenv test-install |
29 |
| - pip install ninja |
30 |
| - ninja --version |
31 |
| - deactivate |
32 |
| - rmvirtualenv test-install |
| 144 | +.. _virtualenvwrapper: https://virtualenvwrapper.readthedocs.io/ |
| 145 | +.. _virtualenv: http://virtualenv.readthedocs.io |
| 146 | +.. _venv: https://docs.python.org/3/library/venv.html |
33 | 147 |
|
34 | 148 |
|
35 | 149 | .. _AppVeyor: https://ci.appveyor.com/project/scikit-build/ninja-python-distributions-f3rbb/history
|
|
0 commit comments