Mercurial > kallithea
annotate scripts/make-release @ 8858:7d5e50517430
diffs: change name of high level function name for generating HTML diff to html_diff
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Thu, 18 Feb 2021 12:23:19 +0100 |
parents | 61bd04b90f58 |
children |
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" |
8193
89e9aef9b983
py3: use "python3 -m venv" instead of virtualenv package
Mads Kiilerich <mads@kiilerich.com>
parents:
8173
diff
changeset
|
18 python3 -m venv "$venv" |
7303
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" |
7987
22321950133a
scripts/make-release: install ldap and pam to fix isort instabilities
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7841
diff
changeset
|
22 pip install --upgrade -e . -r dev_requirements.txt twine python-ldap python-pam |
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
|
23 |
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 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
|
25 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
|
26 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
|
27 hg up -cr . |
5507
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
28 |
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
|
29 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
|
30 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
|
31 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
|
32 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
|
33 |
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
|
34 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
|
35 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
|
36 |
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 echo "Build dist" |
8173
aa6f17a53b49
py3: switch to use Python 3 interpreter, temporarily leaving many things very broken until they have been migrated/fixed in a reviewable way
Mads Kiilerich <mads@kiilerich.com>
parents:
8149
diff
changeset
|
38 python3 setup.py compile_catalog |
aa6f17a53b49
py3: switch to use Python 3 interpreter, temporarily leaving many things very broken until they have been migrated/fixed in a reviewable way
Mads Kiilerich <mads@kiilerich.com>
parents:
8149
diff
changeset
|
39 python3 setup.py sdist |
5507
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
40 |
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
|
41 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
|
42 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
|
43 namerel=${namerel%.tar.gz} |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
44 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
|
45 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
|
46 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
|
47 |
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
|
48 echo "Verify dist file content" |
8097
8f51a05b9856
scripts/make-release: fix check of dist file content after commit 7c7d6b5c07c7
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7987
diff
changeset
|
49 diff -u <((hg mani | grep -v '^\.hg\|^kallithea/i18n/en/LC_MESSAGES/kallithea.mo$') | 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
|
50 |
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 echo "Verify docs build" |
8173
aa6f17a53b49
py3: switch to use Python 3 interpreter, temporarily leaving many things very broken until they have been migrated/fixed in a reviewable way
Mads Kiilerich <mads@kiilerich.com>
parents:
8149
diff
changeset
|
52 python3 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
|
53 |
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
|
54 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
|
55 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
|
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 cat - << EOT |
5507
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
58 |
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
|
59 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
|
60 * 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
|
61 * 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
|
62 * 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
|
63 * 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
|
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 EOT |
5507
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
66 |
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
|
67 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
|
68 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
|
69 |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
70 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
|
71 read answer |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
72 [ "$answer" = "pypi" ] |
d4f66ca15110
release: add scripts/make-release for automation of the release process
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
73 |
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
|
74 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
|
75 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
|
76 curl -X POST http://readthedocs.org/build/kallithea |
8149
ecef27ac1ffa
scripts/make-release: update URL of read-the-docs Builds page
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
8097
diff
changeset
|
77 xdg-open https://readthedocs.org/projects/kallithea/builds |
8604
61bd04b90f58
docs: clean up readthedocs URLs
Mads Kiilerich <mads@kiilerich.com>
parents:
8193
diff
changeset
|
78 xdg-open https://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
|
79 |
7588
e4452268c09f
scripts/make-release: fix PyPI upload by using twine
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7587
diff
changeset
|
80 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
|
81 xdg-open https://pypi.python.org/pypi/Kallithea |