image: nbxmpp-master:latest stages: - test - build - deploy - publish test-pylint: stage: test script: - python3 .ci/pylint-test.py - NBXMPP_EXTERNAL_UNIT_TESTS=1 coverage run --source=nbxmpp -m unittest discover -v - coverage report -mi - coverage xml -i - pip install . coverage: "/TOTAL.+ ([0-9]{1,3}%)/" artifacts: reports: coverage_report: coverage_format: cobertura path: coverage.xml build-unix: stage: build dependencies: [] script: - pip install git+https://dev.gajim.org/gajim/release-helper.git - pip install build - python3 -m build - release-helper build-debian-pkg "$(find dist/nbxmpp-*.tar.gz)" 1 --pkgprefix=python3 --pkgsuffix=nightly artifacts: name: "nbxmpp-$CI_COMMIT_SHA" expire_in: 1 week paths: - dist/nbxmpp-*.tar.gz - dist/nbxmpp-*.whl - debian_build/* deploy-pypi: image: nbxmpp-deploy:latest stage: deploy dependencies: - "build-unix" rules: - if: '$CI_COMMIT_TAG' script: - twine upload --username=__token__ --password=$PYPI_TOKEN dist/* deploy-debian-nightly: image: nbxmpp-deploy:latest stage: deploy dependencies: - build-unix rules: - if: '$NIGHTLY_BUILD' allow_failure: exit_codes: - 100 script: - | if [ "$FORCE_DEB_DEPLOY" != "true" ] then release-helper nightly-check fi - > release-helper deploy-to-ftp \ --host=$FTP_HOST \ --user=$FTP_USER \ --password=$FTP_PASS \ --directory=debian/nbxmpp/"$(date +'%Y%m%d')" \ debian_build publish-release: image: nbxmpp-publish:latest stage: publish dependencies: [] rules: - if: '$CI_COMMIT_TAG' script: - > release-helper create-release \ $CI_PROJECT_ID \ $CI_RELEASE_TOKEN \ --version=$CI_COMMIT_TAG \ --tag=$CI_COMMIT_TAG