|
| 1 | +.. _release: |
| 2 | + |
| 3 | +============================== |
| 4 | + How to release a new version |
| 5 | +============================== |
| 6 | + |
| 7 | +:Release: |version| |
| 8 | +:Date: |today| |
| 9 | + |
| 10 | +The following guide will describe the steps to release a new version of the :pypi:`pytest-celery <pytest-celery>` plugin. |
| 11 | +It will explain how does the CI/CD pipeline work and how to trigger a new release. |
| 12 | + |
| 13 | +.. contents:: |
| 14 | + :local: |
| 15 | + :depth: 3 |
| 16 | + |
| 17 | +CI/CD Pipeline |
| 18 | +============== |
| 19 | + |
| 20 | +Continuous Integration |
| 21 | +~~~~~~~~~~~~~~~~~~~~~~ |
| 22 | + |
| 23 | +.. versionadded:: 1.0.0 |
| 24 | + |
| 25 | +The `CI <https://github.com/celery/pytest-celery/actions>`_ platform is based on GitHub Actions and it is triggered on every push to the repository, |
| 26 | +and on every pull request, according to the changes made. |
| 27 | + |
| 28 | +The configuration files for the CI pipeline are located in the `.github/workflows <https://github.com/celery/pytest-celery/tree/main/.github/workflows>`_ |
| 29 | +directory of the repository. |
| 30 | + |
| 31 | +CI Tests |
| 32 | +-------- |
| 33 | + |
| 34 | +Unit, Integration and Smoke tests. |
| 35 | + |
| 36 | +.. literalinclude:: ../../.github/workflows/python-package.yml |
| 37 | + :language: yaml |
| 38 | + :caption: .github/workflows/python-package.yml |
| 39 | + |
| 40 | +Parallel Tests |
| 41 | +-------------- |
| 42 | + |
| 43 | +These are the :ref:`tox_parallel` and :ref:`tox_xdist` tox environments. The purpose |
| 44 | +of this CI pipeline is to make sure that the plugin is compatible with parallel running, both |
| 45 | +in terms of supporting :pypi:`pytest-xdist <pytest-xdist>` and functionally (i.e. that the plugin |
| 46 | +does not break when running in parallel). |
| 47 | + |
| 48 | +.. literalinclude:: ../../.github/workflows/parallel-support.yml |
| 49 | + :language: yaml |
| 50 | + :caption: .github/workflows/python-package.yml |
| 51 | + |
| 52 | +Linting |
| 53 | +------- |
| 54 | + |
| 55 | +Standard linting checks. |
| 56 | + |
| 57 | +.. literalinclude:: ../../.github/workflows/linter.yml |
| 58 | + :language: yaml |
| 59 | + :caption: .github/workflows/linting.yml |
| 60 | + |
| 61 | +Examples |
| 62 | +-------- |
| 63 | + |
| 64 | +The official plugin examples are tested as part of the standard CI pipeline. |
| 65 | + |
| 66 | +.. literalinclude:: ../../.github/workflows/examples.yml |
| 67 | + :language: yaml |
| 68 | + :caption: .github/workflows/examples.yml |
| 69 | + |
| 70 | +Docker |
| 71 | +------ |
| 72 | + |
| 73 | +This pipeline is used to to make sure the provided Dockerfiles from the plugin are built successfully. |
| 74 | + |
| 75 | +.. literalinclude:: ../../.github/workflows/docker.yml |
| 76 | + :language: yaml |
| 77 | + :caption: .github/workflows/docker.yml |
| 78 | + |
| 79 | +.. _continuous_deployment: |
| 80 | + |
| 81 | +Continuous Deployment |
| 82 | +~~~~~~~~~~~~~~~~~~~~~ |
| 83 | + |
| 84 | +.. versionadded:: 1.0.0 |
| 85 | + |
| 86 | +The `CD <https://github.com/celery/pytest-celery/actions/workflows/deploy.yml>`_ is configured to deploy a new |
| 87 | +release to the `PyPI <https://pypi.org/project/pytest-celery/#history>`_ package index. |
| 88 | + |
| 89 | +The following release workflow is triggered automatically when a new released is tagged and published on GitHub. |
| 90 | + |
| 91 | +.. literalinclude:: ../../.github/workflows/deploy.yml |
| 92 | + :language: yaml |
| 93 | + :caption: .github/workflows/deploy.yml |
| 94 | + |
| 95 | +.. note:: |
| 96 | + |
| 97 | + The ``poetry version`` command should say there's nothing to change, because this should have been done in the PR that prepared the release. |
| 98 | + |
| 99 | +Release Steps |
| 100 | +============= |
| 101 | + |
| 102 | +To make a new release, you need to create a new PR with one of these titles. |
| 103 | + |
| 104 | +- **Official Release**: Prepare for release: vX.Y.Z |
| 105 | +- **Pre-release**: Prepare for (pre) release: vX.Y.Z |
| 106 | + |
| 107 | +The PR should contain the following changes: |
| 108 | + |
| 109 | +- Version bump using `poetry version <https://python-poetry.org/docs/cli#version>`_ command. |
| 110 | +- Changelog update. |
| 111 | + |
| 112 | +This PR will be used as a double check for the CI to make sure everything passes successfully before releasing the new version. |
| 113 | +Once this PR is merged, the last step is to `release a version on GitHub <https://github.com/celery/pytest-celery/releases/new>`_. |
| 114 | +This will trigger the :ref:`CD pipeline <continuous_deployment>` to deploy the new release to PyPI automatically. |
0 commit comments