3 # vim: expandtab sw=4 ts=4 sts=4:
7 if [ -n "$GATEWAY_INTERFACE" ] ; then
8 echo 'Can not invoke as CGI!'
12 # More documentation about making a release is available at:
13 # https://wiki.phpmyadmin.net/pma/Releasing
15 # Fail on undefined variables
20 KITS
="all-languages english source"
21 COMPRESSIONS
="zip-7z txz tgz"
32 while [ $# -gt 0 ] ; do
46 if [ -z "$branch" ] ; then
54 echo " create-release.sh <version> <from_branch> [--tag] [--stable] [--test] [--ci]"
56 echo "If --tag is specified, release tag is automatically created (use this for all releases including pre-releases)"
57 echo "If --stable is specified, the STABLE branch is updated with this release"
58 echo "If --test is specified, the testsuite is executed before creating the release"
59 echo "If --ci is specified, the testsuite is executed and no actual release is crated"
62 echo " create-release.sh 2.9.0-rc1 QA_2_9"
63 echo " create-release.sh 2.9.0 MAINT_2_9_0 --tag --stable"
67 if [ -z "$version" ] ; then
68 version
=`echo $1 | tr -d -c '0-9a-z.-'`
69 if [ "x$version" != "x$1" ] ; then
70 echo "Invalid version: $1"
73 elif [ -z "$branch" ] ; then
74 branch
=`echo $1 | tr -d -c '0-9A-Za-z_-'`
75 if [ "x$branch" != "x$1" ] ; then
76 echo "Invalid branch: $1"
80 echo "Unknown parameter: $1!"
87 if [ -z "$version" -o -z "$branch" ] ; then
88 echo "Branch and version have to be specified!"
92 # Checks whether remote branch has local tracking branch
93 ensure_local_branch
() {
94 if ! git branch |
grep -q '^..'"$1"'$' ; then
95 git branch
--track $1 origin
/$1
99 # Marks current head of given branch as head of other branch
100 # Used for STABLE tracking
104 echo "* Marking release as $rel_branch"
105 ensure_local_branch
$rel_branch
106 git checkout
$rel_branch
107 git merge
-s recursive
-X theirs
$branch
111 # Ensure we have tracking branch
112 ensure_local_branch
$branch
114 # Check if we're releasing older
115 if git cat-file
-e $branch:libraries
/Config.php
2> /dev
/null
; then
116 CONFIG_LIB
=libraries
/Config.php
118 CONFIG_LIB
=libraries
/Config.class.php
121 if [ $do_ci -eq 0 ] ; then
124 Please ensure you have incremented rc count or version in the repository :
125 - in $CONFIG_LIB PMA\libraries\Config::__constructor() the line
126 " \$this->set( 'PMA_VERSION', '$version' ); "
127 - in doc/conf.py the line
128 " version = '$version' "
130 - set release date in ChangeLog
136 if [ "$do_release" != 'y' ]; then
141 # Create working copy
144 workdir
=release
/phpMyAdmin-
$version
145 if [ -d $workdir ] ; then
146 echo "Working directory '$workdir' already exists, please move it out of way"
150 # Add worktree with chosen branch
151 git worktree add
--force $workdir $branch
154 # Check release version
155 if [ $do_ci -eq 0 ] ; then
156 if ! grep -q "'PMA_VERSION', '$version'" $CONFIG_LIB ; then
157 echo "There seems to be wrong version in $CONFIG_LIB!"
160 if ! grep -q "version = '$version'" doc
/conf.py
; then
161 echo "There seems to be wrong version in doc/conf.py"
164 if ! grep -q "Version $version\$" README
; then
165 echo "There seems to be wrong version in README"
170 # Cleanup release dir
171 LC_ALL
=C
date -u > RELEASE-DATE-
${version}
173 # Building documentation
174 echo "* Generating documentation"
175 LC_ALL
=C
make -C doc html
176 find doc
-name '*.pyc' -print0 |
xargs -0 -r rm -f
178 # Check for gettext support
180 echo "* Generating mo files"
181 .
/scripts
/generate-mo
182 if [ -f .
/scripts
/remove-incomplete-mo
] ; then
183 echo "* Removing incomplete translations"
184 .
/scripts
/remove-incomplete-mo
188 if [ -f .
/scripts
/line-counts.sh
] ; then
189 echo "* Generating line counts"
190 .
/scripts
/line-counts.sh
193 echo "* Removing unneeded files"
195 # Remove developer information
198 # Remove phpcs coding standard definition
202 rm -f .travis.yml .coveralls.yml .scrutinizer.yml .jshintrc .weblate codecov.yml
204 # Remove readme for github
207 if [ ! -d libraries
/tcpdf
] ; then
208 echo "* Running composer"
209 composer update
--no-dev
210 # Okay, there is no way to tell composer to install
211 # suggested package. Let's require it and then revert
212 # composer.json to original state.
213 cp composer.json composer.json.backup
214 composer require
--update-no-dev tecnickcom
/tcpdf
215 mv composer.json.backup composer.json
216 echo "* Cleanup of composer packages"
218 vendor
/phpmyadmin
/sql-parser
/tests
/ \
219 vendor
/phpmyadmin
/sql-parser
/tools
/ \
220 vendor
/phpmyadmin
/sql-parser
/locale
/*/LC_MESSAGES
/sqlparser.po \
221 vendor
/phpmyadmin
/motranslator
/tests
/ \
222 vendor
/phpmyadmin
/shapefile
/tests
/ \
223 vendor
/phpmyadmin
/shapefile
/examples
/ \
224 vendor
/phpmyadmin
/shapefile
/data
/ \
225 vendor
/phpseclib
/phpseclib
/phpseclib
/File
/ \
226 vendor
/phpseclib
/phpseclib
/phpseclib
/Math
/ \
227 vendor
/phpseclib
/phpseclib
/phpseclib
/Net
/ \
228 vendor
/phpseclib
/phpseclib
/phpseclib
/System
/ \
229 vendor
/symfony
/expression-language
/Tests
/ \
230 vendor
/symfony
/expression-language
/Resources
/ \
231 vendor
/tecnickcom
/tcpdf
/examples
/ \
232 vendor
/tecnickcom
/tcpdf
/tools
/ \
233 vendor
/tecnickcom
/tcpdf
/fonts
/ae_fonts_
*/ \
234 vendor
/tecnickcom
/tcpdf
/fonts
/dejavu-fonts-ttf-2.33
/ \
235 vendor
/tecnickcom
/tcpdf
/fonts
/freefont-
*/ \
236 vendor
/tecnickcom
/tcpdf
/include
/sRGB.icc \
237 vendor
/google
/recaptcha
/examples
/ \
238 vendor
/google
/recaptcha
/tests
/
239 find vendor
/phpseclib
/phpseclib
/phpseclib
/Crypt
/ -maxdepth 1 -type f
-not -name AES.php
-not -name Base.php
-not -name Random.php
-not -name Rijndael.php
-print0 |
xargs -0 rm
240 find vendor
/tecnickcom
/tcpdf
/fonts
/ -maxdepth 1 -type f
-not -name 'dejavusans.*' -not -name 'dejavusansb.*' -not -name 'helvetica.php' -print0 |
xargs -0 rm
241 if [ $do_tag -eq 1 ] ; then
242 echo "* Commiting composer.lock"
243 sed -i '/composer.lock/D' .gitignore
245 git add composer.lock
246 git commit
-s -m "Adding composer lock for $version"
250 # Remove git metadata
252 find .
-name .gitignore
-print0 |
xargs -0 -r rm -f
254 if [ $do_test -eq 1 ] ; then
256 ant phpunit-nocoverage
258 if [ $do_ci -eq 1 ] ; then
262 if [ "$branch" = "ci" ] ; then
267 if [ $test_ret -ne 0 ] ; then
270 # Remove libs installed for testing
271 if [ ! -d libraries
/tcpdf
] ; then
272 composer update
--no-dev
280 for kit
in $KITS ; do
282 name
=phpMyAdmin-
$version-$kit
283 cp -r phpMyAdmin-
$version $name
285 # Cleanup translations
286 cd phpMyAdmin-
$version-$kit
287 .
/scripts
/lang-cleanup.sh
$kit
289 # Remove tests, source code,...
290 if [ $kit != source ] ; then
291 echo "* Removing source files"
294 rm phpunit.xml.
* build.xml
297 # Documentation source code
302 rm doc
/html
/.buildinfo
doc
/html
/objects.inv
304 rm -rf js
/jquery
/src
/ js
/openlayers
/src
/
307 # Remove developer scripts
312 # Remove tar file possibly left from previous run
315 # Prepare distributions
316 for comp
in $COMPRESSIONS ; do
319 if [ ! -f $name.
tar ] ; then
320 echo "* Creating $name.tar"
321 tar --owner=root
--group=root
--numeric-owner --sort=name
-cf $name.
tar $name
323 if [ $comp = txz
] ; then
324 echo "* Creating $name.tar.xz"
327 if [ $comp = tgz
] ; then
328 echo "* Creating $name.tar.gz"
329 gzip -9c $name.
tar > $name.
tar.gz
333 echo "* Creating $name.zip"
334 7za a
-bd -tzip $name.
zip $name > /dev
/null
337 echo "WARNING: ignoring compression '$comp', not known!"
345 # Remove directory with current dist set
350 rm -rf phpMyAdmin-
${version}
353 # Signing of files with default GPG key
354 echo "* Signing files"
355 for file in *.gz
*.
zip *.xz
; do
356 gpg
--detach-sign --armor $file
357 sha1sum $file > $file.sha1
358 sha256sum
$file > $file.sha256
368 ls -la *.gz
*.
zip *.xz
373 if [ $do_tag -eq 1 ] ; then
375 echo "Additional tasks:"
376 tagname
=RELEASE_
`echo $version | tr . _ | tr '[:lower:]' '[:upper:]' | tr -d -`
377 echo "* Tagging release as $tagname"
378 git tag
-s -a -m "Released $version" $tagname $branch
379 echo " Dont forget to push tags using: git push --tags"
382 # Mark as stable release
383 if [ $do_stable -eq 1 ] ; then
384 mark_as_release
$branch STABLE
393 1. If not already done, tag the repository with the new revision number
394 for a plain release or a release candidate:
395 version 2.7.0 gets RELEASE_2_7_0
396 version 2.7.1-rc1 gets RELEASE_2_7_1RC1
398 2. prepare a release/phpMyAdmin-$version-notes.html explaining in short the goal of
399 this release and paste into it the ChangeLog for this release, followed
400 by the notes of all previous incremental versions (i.e. 4.4.9 through 4.4.0)
401 3. upload the files to our file server, use scripts/upload-release, eg.:
403 ./scripts/upload-release $version release
404 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/
405 5. send a short mail (with list of major changes) to
406 developers@phpmyadmin.net
409 Don't forget to update the Description section in the announcement,
410 based on documentation.
412 6. increment rc count or version in the repository :
413 - in $CONFIG_LIB PMA\libraries\Config::__constructor() the line
414 " \$this->set( 'PMA_VERSION', '2.7.1-dev' ); "
415 - in Documentation.html (if it exists) the 2 lines
416 " <title>phpMyAdmin 2.2.2-rc1 - Documentation</title> "
417 " <h1>phpMyAdmin 2.2.2-rc1 Documentation</h1> "
418 - in doc/conf.py (if it exists) the line
419 " version = '2.7.1-dev' "
421 7. on https://github.com/phpmyadmin/phpmyadmin/milestones close the milestone corresponding to the released version (if this is a stable release) and open a new one for the next minor release
423 8. for a stable version, update demo/php/versions.ini in the scripts repository so that the demo server shows current versions
425 9. in case of a new major release ('y' in x.y.0), update the pmaweb/settings.py in website repository to include the new major releases