/ push-mirrors
push-mirrors
 1  #!/usr/bin/env bash
 2  
 3  # Create a tag and push to EVERY supported mirror.
 4  # https://github.com/cirosantilli/china-dictatorship#mirrors
 5  
 6  set -eux
 7  
 8  # Update repo.
 9  new_version="$(./push-mirrors-bump-package-json-version)"
10  ./push-mirrors-bump-setup-py-version
11  git add package.json
12  git add setup.py
13  git commit -m 'bump package version'
14  git tag -m "$new_version" "$new_version"
15  ./push
16  
17  # NPM package.
18  # Updates package.json version, which other systems read if possible.
19  npm publish
20  
21  # Python package.
22  # Initial setup:
23  #sudo apt install python3-testresources
24  #python3 -m pip install --user --upgrade setuptools wheel
25  # Initial one time setup.
26  #python3 -m pip install --user setuptools wheel twine
27  cp README.adoc README.html china_dictatorship
28  python3 setup.py sdist bdist_wheel
29  # Asks for password every time, unless you setup ~/.pypirc.
30  # But I don't want to put a plaintext password in there.
31  # https://stackoverflow.com/questions/57935191/twine-is-asking-for-my-password-each-time-how-to-use-the-pypirc
32  twine upload dist/*
33  rm -rf build dist *.egg-info
34  
35  # Push to other git mirrors.
36  git push git@bitbucket.org:cirosantilli/china-dictatorship.git
37  git push git@gitlab.binets.fr:ciro.duran-santilli/china-dictatorship.git
38  # Nah.
39  #git push https://gitee.com/cirosantilli/china-dictatorship.git