ci: added semver

This commit is contained in:
2024-11-23 12:05:57 +01:00
parent c8a41565a2
commit abf23f2fee

View File

@ -89,4 +89,33 @@ backend_pytest:
coverage_report:
coverage_format: cobertura
path: coverage.xml
interruptible: true
semver:
stage: Deploy
needs: ["backend_pytest"]
script:
- git config --global user.name "ci_update_bot"
- git config --global user.email "ci_update_bot@bec.ch"
- git checkout "$CI_COMMIT_REF_NAME"
- git reset --hard origin/"$CI_COMMIT_REF_NAME"
# delete all local tags
- git tag -l | xargs git tag -d
- git fetch --tags
- git tag
# build and publish package
- pip install python-semantic-release==9.* wheel build twine
- export GL_TOKEN=$CI_UPDATES
- semantic-release -vv version
# # check if any artifacts were created
# - if [ ! -d dist ]; then echo No release will be made; exit 0; fi
# - twine upload dist/* -u __token__ -p $CI_PYPI_TOKEN --skip-existing
# - semantic-release publish
allow_failure: false
rules:
- if: '$CI_COMMIT_REF_NAME == "main" && $CI_PROJECT_PATH == "bec/bec_atlas"'
interruptible: true