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"
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}
240 ls -la *.gz
*.
zip *.bz2
*.7z
245 if [ $# -gt 0 ] ; then
247 echo "Additional tasks:"
248 while [ $# -gt 0 ] ; do
252 tagname
=RELEASE_
`echo $version | tr . _ | tr '[:lower:]' '[:upper:]' | tr -d -`
253 echo "* Tagging release as $tagname"
254 git tag
-a -m "Released $version" $tagname $branch
255 echo " Dont forget to push tags using: git push --tags"
258 mark_as_release
$branch STABLE
262 echo "Unknown parameter: $1!"
276 1. If not already done, tag the repository with the new revision number
277 for a plain release or a release candidate:
278 version 2.7.0 gets RELEASE_2_7_0
279 version 2.7.1-rc1 gets RELEASE_2_7_1RC1
281 2. prepare a release/phpMyAdmin-$version-notes.html explaining in short the goal of
282 this release and paste into it the ChangeLog for this release
283 3. upload the files to SF, you can use scripts/upload-release, eg.:
285 ./scripts/upload-release \$USER $version release
286 4. if this is the latest stable version, visit https://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin, pick the newly created version, expand the directory and use the I icons to mark that
287 - the -all-languages.zip file is the default for Windows and Others
288 - the -all-languages.tar.gz file is the default for Solaris
289 - the -all-languages.tar.bz2 file is the default for Mac OS X, Linux and BSD
290 5. add a SF news item to phpMyAdmin project; a good idea is to include a link to the release notes such as https://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/4.3.7/phpMyAdmin-4.3.7-notes.html/view because this news item gets relayed via RSS to our Facebook page
291 6. send a short mail (with list of major changes) to
292 phpmyadmin-devel@lists.sourceforge.net
293 phpmyadmin-news@lists.sourceforge.net
295 Don't forget to update the Description section in the announcement,
296 based on documentation.
298 7. increment rc count or version in the repository :
299 - in libraries/Config.class.php PMA_Config::__constructor() the line
300 " \$this->set( 'PMA_VERSION', '2.7.1-dev' ); "
301 - in Documentation.html (if it exists) the 2 lines
302 " <title>phpMyAdmin 2.2.2-rc1 - Documentation</title> "
303 " <h1>phpMyAdmin 2.2.2-rc1 Documentation</h1> "
304 - in doc/conf.py (if it exists) the line
305 " version = '2.7.1-dev' "
307 8. add a milestone for this new version in the bugs tickets, at https://sourceforge.net/p/phpmyadmin/bugs/milestones
309 9. tweet from @phpmya a link to the release notes (see item 5 above); your account should be added to TweetDeck to ease this posting
311 10. for a stable version, update demo/php/versions.ini in the scripts repository so that the demo server shows current versions
313 11. in case of a new major release, update the render.py in website repository to include the new major releases