diff --git a/ci/build_dist.yml b/ci/build_dist.yml index ec4a102bffeb9f86032fac4bf50b16e48a1fcddd..b0c1bcc43f612d6f32760e73cbd91e8b214b9f73 100644 --- a/ci/build_dist.yml +++ b/ci/build_dist.yml @@ -1,18 +1,10 @@ build_dist: stage: build script: - - if [ $CI_COMMIT_REF_NAME = master ]; then - poetry version $(poetry version | cut -d" " -f2)+$(date +%s).${CI_COMMIT_SHORT_SHA} ; - elif [ x$CI_OMMIT_REF_NAME = x$CI_COMMIT_TAG ]; then - if ! [ "$(poetry version | cut -d" " -f2)" = $CI_COMMIT_REF_NAME ]; then - echo "Package version does not match tag. Aborting build of tag!" >/dev/fd/2 ; - exit 1 ; - fi ; + - if ! [ x$CI_COMMIT_REF_NAME = x$CI_COMMIT_TAG ]; then + poetry version $(poetry version | cut -d" " -f2)+$(date --date=${CI_COMMIT_TIMESTAMP} +%Y%m%d%H%M%S).${CI_COMMIT_SHORT_SHA} ; fi - tox -e build artifacts: paths: - dist/ - only: - - master - - tags diff --git a/ci/deploy_pypi.yml b/ci/deploy_pypi.yml index c5c4b0d85237dc8e534923c05c8ee9d5454dc8e6..1d388e3564bdb57fd7b0e4fff2408c53fd919692 100644 --- a/ci/deploy_pypi.yml +++ b/ci/deploy_pypi.yml @@ -2,8 +2,8 @@ deploy_pypi: stage: deploy script: - if [ $CI_COMMIT_REF_NAME = master ]; then - poetry version $(poetry version | cut -d" " -f2)+$(date +%s).${CI_COMMIT_SHORT_SHA} ; - elif [ x$CI_OMMIT_REF_NAME = x$CI_COMMIT_TAG ]; then + poetry version $(poetry version | cut -d" " -f2)+$(date --date=${CI_COMMIT_TIMESTAMP} +%Y%m%d%H%M%S).${CI_COMMIT_SHORT_SHA} ; + elif [ x$CI_COMMIT_REF_NAME = x$CI_COMMIT_TAG ]; then if ! [ "$(poetry version | cut -d" " -f2)" = $CI_COMMIT_REF_NAME ]; then echo "Package version does not match tag. Aborting build of tag!" >/dev/fd/2 ; exit 1 ; @@ -11,7 +11,7 @@ deploy_pypi: fi - if [ $CI_COMMIT_REF_NAME = master ]; then poetry publish -r gitlab ; - elif [ x$CI_OMMIT_REF_NAME = x$CI_COMMIT_TAG ]; then + elif [ x$CI_COMMIT_REF_NAME = x$CI_COMMIT_TAG ]; then poetry publish ; fi only: