diff --git a/.circleci/config.yml b/.circleci/config.yml index 2eca2fae..9d9682c1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -118,6 +118,17 @@ jobs: paths: - . + publish: + docker: + - image: cimg/python:<< pipeline.parameters.python-version >> + steps: + - attach_workspace: + at: . + - deploy: + name: Publish on PyPI + command: | + poetry publish --username "${PYPI_USERNAME}" --password "${PYPI_PASSWORD}" --no-interaction + deploy: docker: - image: cimg/python:<< pipeline.parameters.python-version >> @@ -134,17 +145,6 @@ jobs: --data '{ "ref": "main", "variables": [{"key": "SITE", "value": "dev.data.gouv.fr" }, {"key": "APP", "value": "hydra"}, {"key": "TAGS", "value": "light" }, {"key": "PACKAGE_VERSION", "value": "$PACKAGE_VERSION" }] }' \ https://gitlab.com/api/v4/projects/${GITLAB_PROJECT_ID}/pipeline - publish: - docker: - - image: cimg/python:<< pipeline.parameters.python-version >> - steps: - - attach_workspace: - at: . - - deploy: - name: Publish on PyPI - command: | - poetry publish --username "${PYPI_USERNAME}" --password "${PYPI_PASSWORD}" --no-interaction - workflows: version: 2 build: @@ -172,25 +172,25 @@ workflows: filters: tags: only: /v[0-9]+(\.[0-9]+)*/ - - deploy: + - publish: requires: - build filters: branches: only: - - main + - << pipeline.parameters.publish-branch >> + - /[0-9]+(\.[0-9]+)+/ + - /rc[0-9]+/ tags: only: /v[0-9]+(\.[0-9]+)*/ context: org-global - - publish: + - deploy: requires: - - build + - publish filters: branches: only: - - << pipeline.parameters.publish-branch >> - - /[0-9]+(\.[0-9]+)+/ - - /rc[0-9]+/ + - main tags: only: /v[0-9]+(\.[0-9]+)*/ context: org-global