Files
china-dictatorship/push-mirrors

52 lines
1.5 KiB
Plaintext
Raw Normal View History

#!/usr/bin/env bash
2020-03-17 00:00:09 +00:00
# https://github.com/cirosantilli/china-dictatorship#mirrors
2020-03-17 00:00:06 +00:00
set -eux
2020-03-17 00:00:09 +00:00
2020-03-22 00:00:01 +00:00
make
2020-03-18 00:00:05 +00:00
2020-03-22 00:00:01 +00:00
# GitHub pages.
# One time initial setup.
# git checkout --orphan gh-pages
# and copy over https://github.com/cirosantilli/jekyll-min
2020-03-22 00:00:03 +00:00
gh_pages_dir=out/gh-pages
2020-03-22 00:00:01 +00:00
if [ ! -d "$gh_pages_dir" ]; then
mkdir -p "$gh_pages_dir"
2020-03-22 00:00:02 +00:00
git clone --branch gh-pages "$(git remote get-url origin)"
2020-03-22 00:00:01 +00:00
fi
2020-03-22 00:00:03 +00:00
cp README.html "${gh_pages_dir}/index.html"
git -C "$gh_pages_dir" add index.html
2020-03-22 00:00:04 +00:00
if git -C "$gh_pages_dir" commit -m "$(git log -1 --format="%H")"; then
git -C "$gh_pages_dir" push
fi
2020-03-17 00:00:09 +00:00
2020-03-22 00:00:03 +00:00
# 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
2020-06-15 03:00:02 +00:00
# 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 username and password every time, unless you setup ~/.pypirc.
twine upload dist/*
rm -rf build dist *.egg-info
git add setup.py
2020-03-22 00:00:03 +00:00
# Bump package versions
git commit -m 'bump package version'
2020-03-22 00:00:06 +00:00
git tag -m "$new_version" "$new_version"
2020-06-15 03:00:02 +00:00
# Push to git mirrors.
2020-03-22 00:00:03 +00:00
git push --follow-tags
2020-06-15 03:00:02 +00:00
git push git@gitlab.com:cirosantilli/china-dictatorship.git
git push git@bitbucket.org:cirosantilli/china-dictatorship.git