Mercurial > kallithea
annotate scripts/make-release @ 7534:b06e1141f20f
model: rename confusing kwargs argument for repo_group update method (Issue #331)
author | Edmund Wong <ewong@crazy-cat.org> |
---|---|
date | Mon, 18 Feb 2019 17:00:51 +0800 |
parents | b70ad5c7e706 |
children | cf81d586cf07 |
rev | line source |
---|---|
5507
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
1 #!/bin/bash |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
2 set -e |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
3 set -x |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
4 |
7303
f5b5749113aa
make-release: use a fresh virtualenv for building the release
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7302
diff
changeset
|
5 cleanup() |
f5b5749113aa
make-release: use a fresh virtualenv for building the release
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7302
diff
changeset
|
6 { |
f5b5749113aa
make-release: use a fresh virtualenv for building the release
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7302
diff
changeset
|
7 echo "Removing venv $venv" |
f5b5749113aa
make-release: use a fresh virtualenv for building the release
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7302
diff
changeset
|
8 rm -rf "$venv" |
f5b5749113aa
make-release: use a fresh virtualenv for building the release
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7302
diff
changeset
|
9 } |
f5b5749113aa
make-release: use a fresh virtualenv for building the release
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7302
diff
changeset
|
10 |
f5b5749113aa
make-release: use a fresh virtualenv for building the release
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7302
diff
changeset
|
11 echo "Checking that you are NOT inside a virtualenv" |
f5b5749113aa
make-release: use a fresh virtualenv for building the release
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7302
diff
changeset
|
12 [ -z "$VIRTUAL_ENV" ] |
f5b5749113aa
make-release: use a fresh virtualenv for building the release
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7302
diff
changeset
|
13 |
f5b5749113aa
make-release: use a fresh virtualenv for building the release
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7302
diff
changeset
|
14 venv=$(mktemp -d --tmpdir kallithea-release-XXXXX) |
f5b5749113aa
make-release: use a fresh virtualenv for building the release
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7302
diff
changeset
|
15 trap cleanup EXIT |
f5b5749113aa
make-release: use a fresh virtualenv for building the release
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7302
diff
changeset
|
16 |
f5b5749113aa
make-release: use a fresh virtualenv for building the release
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7302
diff
changeset
|
17 echo "Setting up a fresh virtualenv in $venv" |
f5b5749113aa
make-release: use a fresh virtualenv for building the release
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7302
diff
changeset
|
18 virtualenv -p python2 "$venv" |
f5b5749113aa
make-release: use a fresh virtualenv for building the release
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7302
diff
changeset
|
19 . "$venv/bin/activate" |
f5b5749113aa
make-release: use a fresh virtualenv for building the release
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7302
diff
changeset
|
20 |
7301
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
21 echo "Install/verify tools needed for building and uploading stuff" |
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
22 pip install --upgrade -e . |
7457
cb8de929ecf0
make-release: only specify Sphinx once for pip install
Mads Kiilerich <mads@kiilerich.com>
parents:
7348
diff
changeset
|
23 pip install --upgrade -r dev_requirements.txt Sphinx-PyPI-upload |
7301
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
24 |
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
25 echo "Cleanup and update copyrights ... and clean checkout" |
7191
dba4e770d4b6
make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents:
6791
diff
changeset
|
26 scripts/run-all-cleanup |
7301
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
27 scripts/update-copyrights.py |
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
28 hg up -cr . |
5507
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
29 |
7301
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
30 echo "Make release build from clean checkout in build/" |
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
31 rm -rf build dist |
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
32 hg archive build |
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
33 cd build |
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
34 |
7458
b70ad5c7e706
make-release: drop partial support for shipping the generated style.css and corresponding bootstrap
Mads Kiilerich <mads@kiilerich.com>
parents:
7457
diff
changeset
|
35 echo "Check that each entry in MANIFEST.in match something" |
b70ad5c7e706
make-release: drop partial support for shipping the generated style.css and corresponding bootstrap
Mads Kiilerich <mads@kiilerich.com>
parents:
7457
diff
changeset
|
36 sed -e 's/[^ ]*[ ]*\([^ ]*\).*/\1/g' MANIFEST.in | xargs ls -lad |
7301
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
37 |
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
38 echo "Build dist" |
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
39 python2 setup.py compile_catalog |
5507
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
40 python2 setup.py sdist |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
41 |
7301
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
42 echo "Verify VERSION from kallithea/__init__.py" |
5507
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
43 namerel=$(cd dist && echo Kallithea-*.tar.gz) |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
44 namerel=${namerel%.tar.gz} |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
45 version=${namerel#Kallithea-} |
7301
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
46 ls -l $(pwd)/dist/$namerel.tar.gz |
5507
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
47 echo "Releasing Kallithea $version in directory $namerel" |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
48 |
7301
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
49 echo "Verify dist file content" |
7191
dba4e770d4b6
make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents:
6791
diff
changeset
|
50 diff -u <((hg mani | grep -v '^\.hg') | LANG=C sort) <(tar tf dist/Kallithea-$version.tar.gz | sed "s|^$namerel/||" | grep . | grep -v '^kallithea/i18n/.*/LC_MESSAGES/kallithea.mo$\|^Kallithea.egg-info/\|^PKG-INFO$\|/$' | LANG=C sort) |
7301
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
51 |
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
52 echo "Verify docs build" |
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
53 python2 setup.py build_sphinx # not used yet ... but we want to make sure it builds |
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
54 |
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
55 cat - << EOT |
5507
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
56 |
7301
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
57 Now, make sure |
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
58 * all tests are passing |
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
59 * release note is ready |
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
60 * announcement is ready |
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
61 * source has been pushed to https://kallithea-scm.org/repos/kallithea |
5507
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
62 |
7301
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
63 EOT |
5507
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
64 |
7301
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
65 echo "Verify current revision is tagged for $version" |
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
66 hg log -r "'$version'&." | grep . |
5507
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
67 |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
68 echo -n "Enter \"pypi\" to upload Kallithea $version to pypi: " |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
69 read answer |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
70 [ "$answer" = "pypi" ] |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
71 |
7301
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
72 echo "Upload docs to pypi" |
5507
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
73 # See https://wiki.python.org/moin/PyPiDocumentationHosting |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
74 python2 setup.py build_sphinx upload_sphinx |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
75 xdg-open http://packages.python.org/Kallithea/installation.html |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
76 |
7301
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
77 echo "Rebuild readthedocs for docs.kallithea-scm.org" |
5507
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
78 xdg-open https://readthedocs.org/projects/kallithea/ |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
79 curl -X POST http://readthedocs.org/build/kallithea |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
80 xdg-open https://readthedocs.org/builds/kallithea/ |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
81 xdg-open http://docs.kallithea-scm.org/en/latest/ # or whatever the branch is |
7301
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
82 |
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
83 extraargs=${EMAIL:+--identity=$EMAIL} |
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
84 python2 setup.py sdist upload --sign $extraargs |
d06c0566cb23
make-release: import version and copyright updates from default branch (dba4e770d4b6)
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
5527
diff
changeset
|
85 xdg-open https://pypi.python.org/pypi/Kallithea |