Skip to content

Add a CI job deploying to the official PyPI

Mateusz Żebrak requested to merge mzebrak/deploy-to-pypi into develop

Requires:

Related:

Work done:

  1. Bumped version of Common CI Configuration templates. Created an additional job that will publish to the official PYPI registry only when pipeline is running on a protected tag.

  2. Changed the version format settings (previous are described here)

    Now we use such a logic:

     {%- set dirty_postfix = '.dirty' if dirty else '' -%}
     {%- if distance == 0 and not dirty -%}
         {{ serialize_pep440(base, stage, revision) }}
     {%- elif revision is not none -%}
         {{ serialize_pep440(base, stage, revision + 1, dev=distance, metadata=[commit]) }}{{ dirty_postfix }}
     {%- else -%}
         {{ serialize_pep440(bump_version(base), stage, revision, dev=distance, metadata=[commit]) }}{{ dirty_postfix }}
     {%- endif -%}

    Examples:

    RELEASE TAG

    • HEAD is tagged with v1.27.5.1 --> 1.27.5.1 (accepted by PyPI)
    • dirty HEAD is tagged with v1.27.5.1 --> 1.27.5.2.dev0+cd63dd83.dirty

    with commits:

    • 2 new commits since v1.27.5.1 --> 1.27.5.2.dev2+cd63dd83
    • 2 new commits on a dirty state since v1.27.5.1 --> 1.27.5.2.dev2+cd63dd83.dirty

    RELEASE CANDIDATE (RC):

    • HEAD is tagged with v1.27.5.1rc0 --> 1.27.5.1rc0 (accepted by PyPI)
    • dirty HEAD is tagged with v1.27.5.1rc0 --> 1.27.5.1rc1.dev0+cd63dd83.dirty

    with commits:

    • 2 new commits since v1.27.5.1rc0 --> 1.27.5.1rc1.dev2+cd63dd83
    • 2 new commits on a dirty state since v1.27.5.1rc0 --> 1.27.5.1rc1.dev2+cd63dd83.dirty

    ALPHA

    • HEAD is tagged with v1.27.5.1a0 --> 1.27.5.1a0 (accepted by PyPI)
    • dirty HEAD is tagged with v1.27.5.1a0 --> 1.27.5.1a1.dev0+cd63dd83.dirty

    with commits:

    • 2 new commits since v1.27.5.1a0 --> 1.27.5.1a1.dev2+cd63dd83
    • 2 new commits on a dirty state since v1.27.5.1a0 --> 1.27.5.1a1.dev2+cd63dd83.dirty
Edited by Mateusz Żebrak

Merge request reports

Loading