1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
|
image: nbxmpp-master:latest
stages:
- test
- build
- deploy
- publish
test-isort:
stage: test
rules:
- changes:
- "**/*.py"
script:
- isort --version
- isort --check .
interruptible: true
test-black:
stage: test
rules:
- changes:
- "**/*.py"
script:
- black --version
- black --check .
interruptible: true
test-ruff:
stage: test
rules:
- changes:
- "**/*.py"
script:
- ruff --version
- ruff check .
interruptible: true
test-pyright:
stage: test
rules:
- changes:
- "**/*.py"
script:
- pip install git+https://github.com/pygobject/pygobject-stubs.git
- pyright --version
- pyright
interruptible: true
test-unittest:
stage: test
script:
- python -m unittest discover -v
interruptible: true
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
|