Mercurial > kallithea
annotate scripts/make-release @ 7761:b118e9ffc85c
clone_url: simplify the logic - move summary handling of different URLs with/without id to db
Drop the half-baked concept of a separate "clone_uri_by_id" - just always use a
single template and change back and forth between {repo} and _{repoid} as
necessary.
Make it clear that clone_uri_tmpl always is passed as argument.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Wed, 31 Jul 2019 02:09:04 +0200 |
parents | 08de75df7775 |
children | d9e37f7fd35b |
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 . |
7588
e4452268c09f
scripts/make-release: fix PyPI upload by using twine
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7587
diff
changeset
|
23 pip install --upgrade -r dev_requirements.txt twine |
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" |
7587
cf81d586cf07
scripts/make-release: remove uploading of PyPI docs
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7458
diff
changeset
|
53 python2 setup.py build_sphinx # the results are not actually used, but we want to make sure it builds |
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
|
54 |
7589
08de75df7775
scripts/make-release: print out shortlog for inclusion in release announcements
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7588
diff
changeset
|
55 echo "Shortlog for inclusion in the release announcement" |
08de75df7775
scripts/make-release: print out shortlog for inclusion in release announcements
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7588
diff
changeset
|
56 scripts/shortlog.py "only('.', branch('stable') & tagged() & public() & not '.')" |
08de75df7775
scripts/make-release: print out shortlog for inclusion in release announcements
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7588
diff
changeset
|
57 |
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
|
58 cat - << EOT |
5507
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
59 |
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
|
60 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
|
61 * 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
|
62 * 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
|
63 * 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
|
64 * 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
|
65 |
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
|
66 EOT |
5507
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
67 |
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
|
68 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
|
69 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
|
70 |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
71 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
|
72 read answer |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
73 [ "$answer" = "pypi" ] |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
74 |
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
|
75 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
|
76 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
|
77 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
|
78 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
|
79 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
|
80 |
7588
e4452268c09f
scripts/make-release: fix PyPI upload by using twine
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7587
diff
changeset
|
81 twine upload dist/* |
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 xdg-open https://pypi.python.org/pypi/Kallithea |