forked from cirosantilli/china-dictatorship
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpush-mirrors
executable file
·51 lines (43 loc) · 1.46 KB
/
push-mirrors
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
#!/usr/bin/env bash
# https://github.com/cirosantilli/china-dictatorship#mirrors
set -eux
make
# GitHub pages.
# One time initial setup.
# git checkout --orphan gh-pages
# and copy over https://github.com/cirosantilli/jekyll-min
gh_pages_dir=out/gh-pages
if [ ! -d "$gh_pages_dir" ]; then
mkdir -p "$gh_pages_dir"
git clone --branch gh-pages "$(git remote get-url origin)"
fi
cp README.html "${gh_pages_dir}/index.html"
git -C "$gh_pages_dir" add index.html
if git -C "$gh_pages_dir" commit -m "$(git log -1 --format="%H")"; then
git -C "$gh_pages_dir" push
fi
# 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 username and password every time, unless you setup ~/.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