Files
china-dictatorship/push-mirrors
Ciro Santilli 52d2760c9b gitee
2020-08-21 01:00:00 +00:00

41 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# https://github.com/cirosantilli/china-dictatorship#mirrors
set -eux
./push-gh-pages
# NPM package.
# Updates package.json version, which other systems read if possible.
new_version="$(./push-mirrors-bump-package-json-version)"
npm publish
git add package.json
# Python package.
# Initial setup:
#sudo apt install python3-testresources
#python3 -m pip install --user --upgrade setuptools wheel
./push-mirrors-bump-setup-py-version
# Initial one time setup.
#python3 -m pip install --user setuptools wheel twine
cp README.adoc README.html china_dictatorship
python setup.py sdist bdist_wheel
# Asks for password every time, unless you setup ~/.pypirc.
# But I don't want to put a plaintext password in there.
# https://stackoverflow.com/questions/57935191/twine-is-asking-for-my-password-each-time-how-to-use-the-pypirc
twine upload dist/*
rm -rf build dist *.egg-info
git add setup.py
# Bump package versions
git commit -m 'bump package version'
git tag -m "$new_version" "$new_version"
# Push to git mirrors.
git push --follow-tags
git push git@gitlab.com:cirosantilli/china-dictatorship.git
git push git@bitbucket.org:cirosantilli/china-dictatorship.git
# Nah.
#git push https://gitee.com/cirosantilli/china-dictatorship.git