diff --git a/.harness/publish_python_sdk.yaml b/.harness/publish_python_sdk.yaml index 5df60976..acdae3ab 100644 --- a/.harness/publish_python_sdk.yaml +++ b/.harness/publish_python_sdk.yaml @@ -27,7 +27,7 @@ pipeline: namespace: harness automountServiceAccountToken: true nodeSelector: - node_group: <+input> + node_group: cpu harnessImageConnectorRef: account.dockerhubproxy os: Linux execution: @@ -259,7 +259,12 @@ pipeline: connectorRef: account.harbor image: harbor.devops.indico.io/indico/<+pipeline.variables.service>:<+pipeline.stages.build_info.spec.execution.steps.build_info.output.outputVariables.TEST_IMAGE_TAG> shell: Sh - command: echo "prerelease" + command: |- + #!/bin/bash + rm -rf /indico-client/dist + pip install twine==3.3.0 + python setup.py sdist + twine upload -u __token__ -p <+stage.variables.pypi_token> /indico-client/dist/* when: stageStatus: Success condition: <+<+execution.steps.Info.output.outputVariables.RUN_PRELEASE> == "true"> @@ -281,6 +286,12 @@ pipeline: when: pipelineStatus: Success condition: <+stage.variables.RUN_PUBLISH> == "TRUE" + variables: + - name: pypi_token + type: Secret + description: "" + required: false + value: pypi_publish_token variables: - name: repo type: String @@ -297,8 +308,18 @@ pipeline: description: "" required: true value: <+input>.default(TRUE).allowedValues(TRUE,FALSE) + - name: RUN_PRERELEASE + type: String + description: Publish alpha/prerelease to pypi + value: <+input>.default(FALSE).allowedValues(TRUE,FALSE) + - name: RUN_RELEASE + type: String + description: "" + required: false + value: <+input>.default(FALSE).allowedValues(TRUE,FALSE) - name: RUN_PUBLISH type: String - description: Publish to pypi + description: Run the publish step for release or pre-release + required: false value: <+input>.default(FALSE).allowedValues(TRUE,FALSE) tags: {} diff --git a/.harness/pythonsdkpublish.yaml b/.harness/pythonsdkpublish.yaml new file mode 100644 index 00000000..cbeb9d01 --- /dev/null +++ b/.harness/pythonsdkpublish.yaml @@ -0,0 +1,87 @@ +inputSet: + name: python-sdk-prerelease + tags: {} + identifier: pythonsdkpublish + orgIdentifier: default + projectIdentifier: IPA_Release + pipeline: + identifier: publish_python_sdk + properties: + ci: + codebase: + build: + type: tag + spec: + tag: <+trigger.tag> + stages: + - parallel: + - stage: + identifier: code_checks + template: + templateInputs: + type: CI + variables: + - name: RUN_LINTER + type: String + value: "TRUE" + - name: isort + type: String + value: <+input> + - name: black + type: String + value: <+input> + - name: ruff + type: String + value: <+input> + - name: mypy + type: String + value: <+input> + - name: pylint + type: String + value: <+input> + - stage: + identifier: build_containers + type: CI + variables: + - name: test_poetry_args + type: String + value: <+input> + - name: deploy_poetry_args + type: String + value: <+input> + - name: test_ram + type: String + value: 2G + - name: deploy_ram + type: String + value: 2G + - parallel: + - stage: + identifier: snyk_tests + type: CI + variables: + - name: RUN_SNYK + type: String + value: "FALSE" + - name: container_ram + type: String + value: 2G + variables: + - name: repo + type: String + value: indico-client-python + - name: service + type: String + value: indico-client-python + - name: RUN_UNITTESTS + type: String + value: "TRUE" + - name: RUN_PRERELEASE + type: String + value: "TRUE" + - name: RUN_RELEASE + type: String + value: "FALSE" + - name: RUN_PUBLISH + type: String + value: "TRUE" diff --git a/.harness/pythonsdkrelease.yaml b/.harness/pythonsdkrelease.yaml new file mode 100644 index 00000000..cc948300 --- /dev/null +++ b/.harness/pythonsdkrelease.yaml @@ -0,0 +1,83 @@ +inputSet: + name: python-sdk-release + identifier: pythonsdkrelease + orgIdentifier: default + projectIdentifier: IPA_Release + pipeline: + identifier: publish_python_sdk + properties: + ci: + codebase: + build: + type: tag + spec: + tag: <+trigger.tag> + stages: + - parallel: + - stage: + identifier: code_checks + template: + templateInputs: + type: CI + variables: + - name: RUN_LINTER + type: String + value: "TRUE" + - name: isort + type: String + value: <+input> + - name: black + type: String + value: <+input> + - name: ruff + type: String + value: <+input> + - name: mypy + type: String + value: <+input> + - name: pylint + type: String + value: <+input> + - stage: + identifier: build_containers + type: CI + variables: + - name: test_poetry_args + type: String + value: <+input> + - name: deploy_poetry_args + type: String + value: <+input> + - name: test_ram + type: String + value: 2G + - name: deploy_ram + type: String + value: 2G + - parallel: + - stage: + identifier: snyk_tests + type: CI + variables: + - name: RUN_SNYK + type: String + value: "FALSE" + - name: container_ram + type: String + value: 2G + variables: + - name: repo + type: String + value: indico-client-python + - name: service + type: String + value: indico-client-python + - name: RUN_UNITTESTS + type: String + value: "TRUE" + - name: RUN_PRERELEASE + type: String + value: "FALSE" + - name: RUN_RELEASE + type: String + value: "TRUE"