2021-09-22 00:04:11 +02:00
|
|
|
sync-to-github:
|
|
|
|
stage: build
|
|
|
|
script:
|
|
|
|
- echo "Synchronizing repo state to Github"
|
|
|
|
- export REPO_DIR="$(mktemp -d /tmp/platypush-XXXXX)"
|
|
|
|
- git clone git@git.platypush.tech:platypush/platypush.git "$REPO_DIR"
|
|
|
|
- cd "$REPO_DIR"
|
|
|
|
- git remote add github git@github.com:/BlackLight/platypush.git
|
|
|
|
- git checkout $CI_COMMIT_BRANCH
|
|
|
|
- git pull
|
|
|
|
- git push --mirror -v github
|
|
|
|
|
|
|
|
run-tests:
|
|
|
|
stage: test
|
|
|
|
script:
|
|
|
|
- ./.gitlab/run_ci_tests.sh
|
|
|
|
|
|
|
|
rebuild-docs:
|
|
|
|
stage: deploy
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
script:
|
|
|
|
- ./.gitlab/rebuild_docs.sh
|
|
|
|
|
|
|
|
update-aur-packages:
|
|
|
|
stage: deploy
|
|
|
|
only:
|
|
|
|
- master
|
2021-09-22 00:36:51 +02:00
|
|
|
- tags
|
2021-09-22 00:04:11 +02:00
|
|
|
script:
|
|
|
|
- echo "Updating AUR packages"
|
|
|
|
- export REPO_DIR="$(mktemp -d /tmp/platypush-distutils-XXXXX)"
|
|
|
|
- git clone git@fabiomanganiello.com:/home/git/platypush-distutils.git "$REPO_DIR"
|
|
|
|
- cd "$REPO_DIR"
|
|
|
|
- git submodule init
|
|
|
|
- git submodule update
|
|
|
|
- cd distro/arch/git
|
|
|
|
- git checkout master
|
|
|
|
- git pull --rebase
|
|
|
|
- cd ../../../
|
|
|
|
- cd distro/arch/stable
|
|
|
|
- git checkout master
|
|
|
|
- git pull --rebase
|
|
|
|
- cd ../../../
|
|
|
|
- ./update.sh
|
|
|
|
- cd distro/arch/git
|
|
|
|
- changes="$(git status --porcelain --untracked-files=no)"
|
|
|
|
- "[[ -n \"$changes\" ]] && git commit -a -m '[Automatic] Package updated' && git push || echo 'No changes'"
|
|
|
|
- cd ../../../
|
|
|
|
- cd distro/arch/stable
|
|
|
|
- changes="$(git status --porcelain --untracked-files=no)"
|
|
|
|
- "[[ -n \"$changes\" ]] && git commit -a -m '[Automatic] Package updated' && git push || echo 'No changes'"
|
|
|
|
|
|
|
|
upload-pip-package:
|
|
|
|
stage: deploy
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
script:
|
|
|
|
- rm -rf build dist *.egg-info
|
|
|
|
- export VERSION=$(grep -e '^\s*__version__\s*=' platypush/__init__.py | sed -r -e 's/^\s*__version__\s*=\s*.(.+?).\s*$/\1/')
|
|
|
|
- source ~/.credentials/pypi.env
|
|
|
|
- python setup.py sdist bdist_wheel
|
2021-09-25 12:53:30 +02:00
|
|
|
# Upload to PyPI
|
2021-09-22 00:04:11 +02:00
|
|
|
- twine upload ./dist/platypush-${VERSION}.tar.gz
|
2021-09-25 12:53:30 +02:00
|
|
|
# Upload to the local package repository
|
|
|
|
- TWINE_PASSWORD=$LOCAL_TWINE_PASSWORD TWINE_USERNAME=$LOCAL_TWINE_USERNAME twine upload --repository-url https://git.platypush.tech/api/v4/projects/3/packages/pypi dist/platypush-${VERSION}.tar.gz
|