Loading README.md +5 −3 Original line number Diff line number Diff line Loading @@ -270,13 +270,15 @@ It is bound to the `publish` stage, applies only on git tags and uses the follow | Name | description | default value | | ---------------------- | -------------------------------------------------------- | ----------------- | | `TWINE_REPOSITORY_URL` | Where to publish your Python project | _none_ (disabled) | | `TWINE_USERNAME` | Username credential to publish to \$TWINE_REPOSITORY_URL | _none_ (disabled) | | `TWINE_PASSWORD` | Password credential to publish to \$TWINE_REPOSITORY_URL | _none_ | | `PYTHON_PUBLISH_ENABLED`| Set to `true` to enable the publish job | _none_ (disabled) | | `TWINE_REPOSITORY_URL` | Where to publish your Python project | GitLab Project's Pypi Packages registry | | `TWINE_USERNAME` | Username credential to publish to \$TWINE_REPOSITORY_URL | `gitlab-ci-token` | | `TWINE_PASSWORD` | Password credential to publish to \$TWINE_REPOSITORY_URL | `$CI_JOB_TOKEN` | More info: * [Python Packaging User Guide](https://packaging.python.org/) * [PyPI packages in the Package Registry](https://docs.gitlab.com/ee/user/packages/pypi_repository/) If you want to automatically create tag and publish your Python package, please have a look [here](#release-python) Loading kicker.json +4 −3 Original line number Diff line number Diff line Loading @@ -163,24 +163,25 @@ "id": "publish", "name": "Publish", "description": "Publish your code to a [Twine](https://pypi.org/project/twine/) repository", "enable_with": "PYTHON_PUBLISH_ENABLED", "variables": [ { "name": "TWINE_REPOSITORY_URL", "type": "url", "description": "Twine repository url to publish you python project", "mandatory": true "default": "${CI_SERVER_URL}/api/v4/projects/${CI_PROJECT_ID}/packages/pypi" }, { "name": "TWINE_USERNAME", "description": "Twine repository username credential", "secret": true, "mandatory": true "default": "gitlab-ci-token" }, { "name": "TWINE_PASSWORD", "description": "Twine repository password credential", "secret": true, "mandatory": true "default": "$CI_JOB_TOKEN" } ] }, Loading templates/gitlab-ci-python.yml +9 −2 Original line number Diff line number Diff line Loading @@ -45,6 +45,13 @@ variables: RELEASE_VERSION_PART: "minor" # By default, publish on the Packages registry of the project # https://docs.gitlab.com/ee/user/packages/pypi_repository/#authenticate-with-a-ci-job-token TWINE_REPOSITORY_URL: ${CI_SERVER_URL}/api/v4/projects/${CI_PROJECT_ID}/packages/pypi TWINE_USERNAME: 'gitlab-ci-token' TWINE_PASSWORD: $CI_JOB_TOKEN .python-scripts: &python-scripts | # BEGSCRIPT set -e Loading Loading @@ -610,8 +617,8 @@ py-publish: - assert_defined "$TWINE_PASSWORD" 'Missing required env $TWINE_PASSWORD' - _publish rules: # on tags with $TWINE_USERNAME set - if: '$TWINE_USERNAME && $CI_COMMIT_TAG' # on tags with $PYTHON_PUBLISH_ENABLED set - if: '$PYTHON_PUBLISH_ENABLED == "true" && $CI_COMMIT_TAG' Loading Loading
README.md +5 −3 Original line number Diff line number Diff line Loading @@ -270,13 +270,15 @@ It is bound to the `publish` stage, applies only on git tags and uses the follow | Name | description | default value | | ---------------------- | -------------------------------------------------------- | ----------------- | | `TWINE_REPOSITORY_URL` | Where to publish your Python project | _none_ (disabled) | | `TWINE_USERNAME` | Username credential to publish to \$TWINE_REPOSITORY_URL | _none_ (disabled) | | `TWINE_PASSWORD` | Password credential to publish to \$TWINE_REPOSITORY_URL | _none_ | | `PYTHON_PUBLISH_ENABLED`| Set to `true` to enable the publish job | _none_ (disabled) | | `TWINE_REPOSITORY_URL` | Where to publish your Python project | GitLab Project's Pypi Packages registry | | `TWINE_USERNAME` | Username credential to publish to \$TWINE_REPOSITORY_URL | `gitlab-ci-token` | | `TWINE_PASSWORD` | Password credential to publish to \$TWINE_REPOSITORY_URL | `$CI_JOB_TOKEN` | More info: * [Python Packaging User Guide](https://packaging.python.org/) * [PyPI packages in the Package Registry](https://docs.gitlab.com/ee/user/packages/pypi_repository/) If you want to automatically create tag and publish your Python package, please have a look [here](#release-python) Loading
kicker.json +4 −3 Original line number Diff line number Diff line Loading @@ -163,24 +163,25 @@ "id": "publish", "name": "Publish", "description": "Publish your code to a [Twine](https://pypi.org/project/twine/) repository", "enable_with": "PYTHON_PUBLISH_ENABLED", "variables": [ { "name": "TWINE_REPOSITORY_URL", "type": "url", "description": "Twine repository url to publish you python project", "mandatory": true "default": "${CI_SERVER_URL}/api/v4/projects/${CI_PROJECT_ID}/packages/pypi" }, { "name": "TWINE_USERNAME", "description": "Twine repository username credential", "secret": true, "mandatory": true "default": "gitlab-ci-token" }, { "name": "TWINE_PASSWORD", "description": "Twine repository password credential", "secret": true, "mandatory": true "default": "$CI_JOB_TOKEN" } ] }, Loading
templates/gitlab-ci-python.yml +9 −2 Original line number Diff line number Diff line Loading @@ -45,6 +45,13 @@ variables: RELEASE_VERSION_PART: "minor" # By default, publish on the Packages registry of the project # https://docs.gitlab.com/ee/user/packages/pypi_repository/#authenticate-with-a-ci-job-token TWINE_REPOSITORY_URL: ${CI_SERVER_URL}/api/v4/projects/${CI_PROJECT_ID}/packages/pypi TWINE_USERNAME: 'gitlab-ci-token' TWINE_PASSWORD: $CI_JOB_TOKEN .python-scripts: &python-scripts | # BEGSCRIPT set -e Loading Loading @@ -610,8 +617,8 @@ py-publish: - assert_defined "$TWINE_PASSWORD" 'Missing required env $TWINE_PASSWORD' - _publish rules: # on tags with $TWINE_USERNAME set - if: '$TWINE_USERNAME && $CI_COMMIT_TAG' # on tags with $PYTHON_PUBLISH_ENABLED set - if: '$PYTHON_PUBLISH_ENABLED == "true" && $CI_COMMIT_TAG' Loading