From dd1a2487636e4dfe31963ab6e43b800b7fbe641e Mon Sep 17 00:00:00 2001 From: Byron Lathi Date: Thu, 6 Jun 2024 18:45:09 -0700 Subject: [PATCH] Only deploy on merges to master --- .gitlab-ci.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ee84466..0c9bdd0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,28 @@ image: python:latest -run: +stages: + - build + - test + - deploy + +build: + stage: build + artifacts: + paths: + - ./dist script: - source init_env.sh - python -m build + +test: + stage: test + script: + - echo "Haha no tests yet" + +deploy: + stage: deploy + only: + - master + - merge_requests + script: - TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${PACKAGE_PROJECT_ID}/packages/pypi dist/*