3 # vim: expandtab sw=4 ts=4 sts=4:
6 # More documentation about making a release is available at:
7 # http://wiki.phpmyadmin.net/pma/Releasing
9 # Fail on undefined variables
14 KITS
="all-languages english"
15 COMPRESSIONS
="zip-7z tbz txz tgz 7z"
20 echo " create-release.sh <version> <from_branch> [--tag] [--stable]"
22 echo "If --tag is specified, release tag is automatically created (do not use this on pre-release versions)"
23 echo "If --stable is specified, the STABLE branch is updated with this release"
26 echo " create-release.sh 2.9.0-rc1 QA_2_9"
27 echo " create-release.sh 2.9.0 MAINT_2_9_0 --tag --stable"
32 # Checks whether remote branch has local tracking branch
33 ensure_local_branch
() {
34 if ! git branch |
grep -q '^..'"$1"'$' ; then
35 git branch
--track $1 origin
/$1
39 # Marks current head of given branch as head of other branch
40 # Used for STABLE tracking
44 echo "* Marking release as $rel_branch"
45 ensure_local_branch
$rel_branch
46 git checkout
$rel_branch
47 git merge
-s recursive
-X theirs
$branch
50 # Read required parameters
58 Please ensure you have incremented rc count or version in the repository :
59 - in libraries/Config.class.php PMA_Config::__constructor() the line
60 " \$this->set( 'PMA_VERSION', '$version' ); "
61 - in doc/conf.py the line
62 " version = '$version' "
69 if [ "$do_release" != 'y' ]; then
73 # Ensure we have tracking branch
74 ensure_local_branch
$branch
78 workdir
=release
/phpMyAdmin-
$version
79 if [ -d $workdir ] ; then
80 echo "Working directory '$workdir' already exists, please move it out of way"
83 git clone
--local .
$workdir
87 ensure_local_branch
$branch
90 # Check release version
91 if ! grep -q "'PMA_VERSION', '$version'" libraries
/Config.class.php
; then
92 echo "There seems to be wrong version in libraries/Config.class.php!"
95 if test -f Documentation.html
&& ! grep -q "phpMyAdmin $version - Documentation" Documentation.html
; then
96 echo "There seems to be wrong version in Documentation.html"
98 if test -f doc
/conf.py
&& ! grep -q "version = '$version'" doc
/conf.py
; then
99 echo "There seems to be wrong version in doc/conf.py"
102 if ! grep -q "Version $version\$" README
; then
103 echo "There seems to be wrong version in README"
107 # Cleanup release dir
108 LC_ALL
=C
date -u > RELEASE-DATE-
${version}
110 # Building documentation
111 echo "* Generating documentation"
112 if [ -f doc
/conf.py
] ; then
113 LC_ALL
=C
make -C doc html
114 find doc
-name '*.pyc' -print0 |
xargs -0 -r rm -f
116 LC_ALL
=C w3m
-dump Documentation.html
> Documentation.txt
119 # Check for gettext support
121 echo "* Generating mo files"
122 .
/scripts
/generate-mo
123 if [ -f .
/scripts
/remove-incomplete-mo
] ; then
124 echo "* Removing incomplete translations"
125 .
/scripts
/remove-incomplete-mo
127 echo "* Removing gettext source files"
131 if [ -f .
/scripts
/line-counts.sh
] ; then
132 echo "* Generating line counts"
133 .
/scripts
/line-counts.sh
136 echo "* Removing unneeded files"
138 # Remove test directory from package to avoid Path disclosure messages
139 # if someone runs /test/wui.php and there are test failures
142 # Remove phpcs coding standard definition
146 rm -f build.xml phpunit.xml.dist .travis.yml .jshintrc
148 # Remove readme for github
151 # Remove git metadata
153 find .
-name .gitignore
-print0 |
xargs -0 -r rm -f
158 for kit
in $KITS ; do
160 name
=phpMyAdmin-
$version-$kit
161 cp -r phpMyAdmin-
$version $name
163 # Cleanup translations
164 cd phpMyAdmin-
$version-$kit
165 scripts
/lang-cleanup.sh
$kit
166 if [ -f sql
/create_tables.sql
] ; then
171 # Remove javascript compiler, no need to ship it
172 rm -rf scripts
/google-javascript-compiler
/
174 # Remove scripts which are not useful for user
175 for s
in generate-sprites advisor2po lang-cleanup.sh locales-contributors remove-incomplete-mo compress-js create-release.sh generate-mo remove_control_m.sh update-po upload-release
; do
181 # Remove tar file possibly left from previous run
184 # Prepare distributions
185 for comp
in $COMPRESSIONS ; do
188 if [ ! -f $name.
tar ] ; then
189 echo "* Creating $name.tar"
190 tar cf
$name.
tar $name
192 if [ $comp = tbz
] ; then
193 echo "* Creating $name.tar.bz2"
196 if [ $comp = txz
] ; then
197 echo "* Creating $name.tar.xz"
200 if [ $comp = tgz
] ; then
201 echo "* Creating $name.tar.gz"
202 gzip -9c $name.
tar > $name.
tar.gz
206 echo "* Creating $name.zip"
207 zip -q -9 -r $name.
zip $name
210 echo "* Creating $name.zip"
211 7za a
-bd -tzip $name.
zip $name > /dev
/null
214 echo "* Creating $name.7z"
215 7za a
-bd $name.7z
$name > /dev
/null
218 echo "WARNING: ignoring compression '$comp', not known!"
226 # Remove directory with current dist set
231 rm -rf phpMyAdmin-
${version}
233 # Signing of files with default GPG key
234 echo "* Signing files"
235 for file in *.gz
*.
zip *.xz
*.bz2
*.7z
; do
236 gpg
--detach-sign --armor $file
237 md5sum $file > $file.md5
238 sha1sum $file > $file.sha1
248 ls -la *.gz
*.
zip *.xz
*.bz2
*.7z
253 if [ $# -gt 0 ] ; then
255 echo "Additional tasks:"
256 while [ $# -gt 0 ] ; do
260 tagname
=RELEASE_
`echo $version | tr . _ | tr '[:lower:]' '[:upper:]' | tr -d -`
261 echo "* Tagging release as $tagname"
262 git tag
-a -m "Released $version" $tagname $branch
263 echo " Dont forget to push tags using: git push --tags"
266 mark_as_release
$branch STABLE
270 echo "Unknown parameter: $1!"
284 1. If not already done, tag the repository with the new revision number
285 for a plain release or a release candidate:
286 version 2.7.0 gets RELEASE_2_7_0
287 version 2.7.1-rc1 gets RELEASE_2_7_1RC1
289 2. prepare a release/phpMyAdmin-$version-notes.html explaining in short the goal of
290 this release and paste into it the ChangeLog for this release, followed
291 by the notes of all previous incremental versions (i.e. 4.4.9 through 4.4.0)
292 3. upload the files to our file server, use scripts/upload-release, eg.:
294 ./scripts/upload-release $version release
295 4. add a news item to our website; a good idea is to include a link to the release notes such as https://www.phpmyadmin.net/files/4.4.10/
296 5. send a short mail (with list of major changes) to
297 developers@phpmyadmin.net
300 Don't forget to update the Description section in the announcement,
301 based on documentation.
303 6. increment rc count or version in the repository :
304 - in libraries/Config.class.php PMA_Config::__constructor() the line
305 " \$this->set( 'PMA_VERSION', '2.7.1-dev' ); "
306 - in Documentation.html (if it exists) the 2 lines
307 " <title>phpMyAdmin 2.2.2-rc1 - Documentation</title> "
308 " <h1>phpMyAdmin 2.2.2-rc1 Documentation</h1> "
309 - in doc/conf.py (if it exists) the line
310 " version = '2.7.1-dev' "
312 7. add a milestone for this new version in the bugs tickets, at https://sourceforge.net/p/phpmyadmin/bugs/milestones and set it to the default one
314 8. tweet from @phpmya a link to the release notes (see item 5 above); your account should be added to TweetDeck to ease this posting
316 9. for a stable version, update demo/php/versions.ini in the scripts repository so that the demo server shows current versions
318 10. in case of a new major release, update the pmaweb/settings.py in website repository to include the new major releases