35 lines
674 B
YAML
35 lines
674 B
YAML
image: python:latest
|
|
|
|
stages:
|
|
- build
|
|
- test
|
|
- deploy
|
|
|
|
build:
|
|
stage: build
|
|
rules:
|
|
- when: always
|
|
artifacts:
|
|
paths:
|
|
- ./dist
|
|
script:
|
|
- source init_env.sh
|
|
- python -m build
|
|
|
|
test:
|
|
stage: test
|
|
rules:
|
|
- when: always
|
|
script:
|
|
- echo "Haha no tests yet"
|
|
|
|
deploy:
|
|
stage: deploy
|
|
rules:
|
|
# only run on MRs to main
|
|
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"
|
|
# run on commits to main
|
|
- if: $CI_COMMIT_BRANCH == "main"
|
|
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/*
|