annotate scripts/make-release @ 7242:476daae2a94c

style: generate pygments.css directly with pygmentize -a This avoids 'sed' post-processing of the generated css. pygments.css can thus be generated with: pygmentize -S default -f html -a .code-highlight > kallithea/public/css/pygments.css
author Mads Kiilerich <mads@kiilerich.com>
date Sun, 15 Apr 2018 22:41:02 +0200
parents dba4e770d4b6
children b3289fef0daa
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
7191
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
5 echo "Install/verify tools needed for building and uploading stuff"
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
6 pip install --upgrade -e .
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
7 pip install --upgrade -r dev_requirements.txt Sphinx Sphinx-PyPI-upload
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
8
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
9 echo "Cleanup and update copyrights ... and clean checkout"
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
10 scripts/run-all-cleanup
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
11 scripts/update-copyrights.py
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
12 hg up -cr .
5507
d4f66ca15110 release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff changeset
13
7191
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
14 echo "Make release build from clean checkout in build/"
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
15 rm -rf build dist
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
16 hg archive build
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
17 cd build
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
18
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
19 echo "Check MANIFEST.in"
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
20 sed -e 's/[^ ]*[ ]*\([^ ]*\).*/\1/g' MANIFEST.in | grep -v '^node_modules/bootstrap\|^kallithea/public/css/style.css' | xargs ls -lad
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
21
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
22 echo "Build dist"
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
23 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
24 python2 setup.py sdist
d4f66ca15110 release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff changeset
25
7191
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
26 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
27 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
28 namerel=${namerel%.tar.gz}
d4f66ca15110 release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff changeset
29 version=${namerel#Kallithea-}
7191
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
30 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
31 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
32
7191
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
33 echo "Verify dist file content"
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
34 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)
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
35 ! tar tf dist/Kallithea-$version.tar.gz | grep "$namerel/node_modules/bootstrap/\$"
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
36
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
37 echo "Verify docs build"
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
38 python2 setup.py build_sphinx # not used yet ... but we want to make sure it builds
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
39
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
40 cat - << EOT
5507
d4f66ca15110 release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff changeset
41
7191
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
42 Now, make sure
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
43 * the copyright and contributor lists have been updated
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
44 * all tests are passing
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
45 * release note is ready
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
46 * announcement is ready
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
47 * 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
48
7191
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
49 EOT
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
50
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
51 echo "Verify current revision is tagged for $version"
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
52 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
53
d4f66ca15110 release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff changeset
54 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
55 read answer
d4f66ca15110 release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff changeset
56 [ "$answer" = "pypi" ]
d4f66ca15110 release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff changeset
57
7191
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
58 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
59 # 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
60 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
61 xdg-open https://pythonhosted.org/Kallithea/
d4f66ca15110 release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff changeset
62 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
63
7191
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
64 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
65 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
66 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
67 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
68 xdg-open http://docs.kallithea-scm.org/en/latest/ # or whatever the branch is
7191
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
69
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
70 extraargs=${EMAIL:+--identity=$EMAIL}
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
71 python2 setup.py sdist upload --sign $extraargs
dba4e770d4b6 make-release: cleanup and fix bitrot
Mads Kiilerich <mads@kiilerich.com>
parents: 6791
diff changeset
72 xdg-open https://pypi.python.org/pypi/Kallithea