From 428a13ceeb65fe32e2c2028e11cdebf6cf489331 Mon Sep 17 00:00:00 2001 From: Klaus Wakonig Date: Wed, 28 Jun 2023 13:31:44 +0200 Subject: [PATCH 1/2] refactor: prep for semver --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 52eee07..e9c4273 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup -__version__ = "0.0.1" +__version__ = "0.0.0" if __name__ == "__main__": setup( From 9c0bd1e1946eed2b14146c690b3e63825bcc77fe Mon Sep 17 00:00:00 2001 From: Klaus Wakonig Date: Wed, 28 Jun 2023 13:32:07 +0200 Subject: [PATCH 2/2] ci: added semver --- .gitlab-ci.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d0c4f6f..27f13f4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,4 +24,30 @@ pytest: script: - pytest -v --random-order ./tests +semver: + stage: Deploy + needs: ["tests"] + 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 + - pip install python-semantic-release wheel + - export GL_TOKEN=$CI_UPDATES + - export REPOSITORY_USERNAME=__token__ + - export REPOSITORY_PASSWORD=$CI_PYPI_TOKEN + - > + semantic-release publish -v DEBUG + -D version_variable=./setup.py:__version__ + -D hvcs=gitlab + + allow_failure: false + rules: + - if: '$CI_COMMIT_REF_NAME == "master"' \ No newline at end of file