Translated using Weblate (Slovenian)
[phpmyadmin.git] / scripts / create-release.sh
blob9f100b75f422436d24cde0f9d62ccf9ec44f5288
1 #!/bin/sh
3 # vim: expandtab sw=4 ts=4 sts=4:
6 # Do not run as CGI
7 if [ -n "$GATEWAY_INTERFACE" ] ; then
8 echo 'Can not invoke as CGI!'
9 exit 1
12 # More documentation about making a release is available at:
13 # https://wiki.phpmyadmin.net/pma/Releasing
15 # Fail on undefined variables
16 set -u
17 # Fail on failure
18 set -e
20 KITS="all-languages english source"
21 COMPRESSIONS="zip-7z txz tgz"
22 # The version series this script is allowed to handle
23 VERSION_SERIES="5.3"
25 # Process parameters
27 version=""
28 branch=""
29 do_tag=0
30 do_stable=0
31 do_test=0
32 do_ci=0
33 do_sign=1
34 do_pull=0
35 do_daily=0
37 while [ $# -gt 0 ] ; do
38 case "$1" in
39 --tag)
40 do_tag=1
42 --stable)
43 do_stable=1
45 --test)
46 do_test=1
48 --daily)
49 do_sign=0
50 do_pull=1
51 do_daily=1
52 do_test=1
54 --ci)
55 do_test=1
56 do_ci=1
57 if [ -z "$branch" ] ; then
58 git branch ci
59 branch="ci"
61 version="${VERSION_SERIES}+ci"
63 --help)
64 echo "Usages:"
65 echo " create-release.sh <version> <from_branch> [--tag] [--stable] [--test] [--ci]"
66 echo ""
67 echo "If --tag is specified, release tag is automatically created (use this for all releases including pre-releases)"
68 echo "If --stable is specified, the STABLE branch is updated with this release"
69 echo "If --test is specified, the testsuite is executed before creating the release"
70 echo "If --ci is specified, the testsuite is executed and no actual release is created"
71 echo ""
72 echo "Examples:"
73 echo " create-release.sh 2.9.0-rc1 QA_2_9"
74 echo " create-release.sh 2.9.0 MAINT_2_9_0 --tag --stable"
75 exit 65
78 do_test=1
79 if [ -z "$version" ] ; then
80 version=`echo $1 | tr -d -c '0-9a-z.+-'`
81 if [ "x$version" != "x$1" ] ; then
82 echo "Invalid version: $1"
83 exit 1
85 elif [ -z "$branch" ] ; then
86 branch=`echo $1 | tr -d -c '/0-9A-Za-z_-'`
87 if [ "x$branch" != "x$1" ] ; then
88 echo "Invalid branch: $1"
89 exit 1
91 else
92 echo "Unknown parameter: $1!"
93 exit 1
95 esac
96 shift
97 done
99 if [ -z "$version" -o -z "$branch" ] ; then
100 echo "Branch and version have to be specified!"
101 exit 1
104 # Checks whether remote branch has local tracking branch
105 ensure_local_branch() {
106 if ! git branch | grep -q '^..'"$1"'$' ; then
107 git branch --track $1 origin/$1
111 # Marks current head of given branch as head of other branch
112 # Used for STABLE tracking
113 mark_as_release() {
114 branch=$1
115 rel_branch=$2
116 echo "* Marking release as $rel_branch"
117 ensure_local_branch $rel_branch
118 git checkout $rel_branch
119 git merge -s recursive -X theirs $branch
120 git checkout master
123 cleanup_composer_vendors() {
124 echo "* Cleanup of composer packages"
125 rm -rf \
126 vendor/phpmyadmin/sql-parser/tests/ \
127 vendor/phpmyadmin/sql-parser/tools/ \
128 vendor/phpmyadmin/sql-parser/src/Tools/ \
129 vendor/phpmyadmin/sql-parser/locale/sqlparser.pot \
130 vendor/phpmyadmin/sql-parser/locale/*/LC_MESSAGES/sqlparser.po \
131 vendor/phpmyadmin/sql-parser/bin/ \
132 vendor/phpmyadmin/sql-parser/phpunit.xml.dist \
133 vendor/phpmyadmin/motranslator/phpunit.xml.dist \
134 vendor/phpmyadmin/motranslator/tests/ \
135 vendor/phpmyadmin/shapefile/codecov.yml \
136 vendor/phpmyadmin/shapefile/phpunit.xml.dist \
137 vendor/phpmyadmin/shapefile/tests/ \
138 vendor/phpmyadmin/shapefile/examples/ \
139 vendor/phpmyadmin/shapefile/data/ \
140 vendor/phpmyadmin/shapefile/phpstan-baseline.neon \
141 vendor/phpmyadmin/shapefile/phpstan.neon.dist \
142 vendor/phpmyadmin/twig-i18n-extension/README.rst \
143 vendor/phpmyadmin/twig-i18n-extension/phpunit.xml.dist \
144 vendor/phpmyadmin/twig-i18n-extension/test/ \
145 vendor/phpseclib/phpseclib/phpseclib/File/ \
146 vendor/phpseclib/phpseclib/phpseclib/Math/ \
147 vendor/phpseclib/phpseclib/phpseclib/Net/ \
148 vendor/phpseclib/phpseclib/phpseclib/System/ \
149 vendor/phpseclib/phpseclib/appveyor.yml \
150 vendor/phpseclib/phpseclib/.github \
151 vendor/symfony/cache/Tests/ \
152 vendor/symfony/service-contracts/Test/ \
153 vendor/symfony/expression-language/Tests/ \
154 vendor/symfony/expression-language/Resources/ \
155 vendor/symfony/dependency-injection/Loader/schema/dic/services/services-1.0.xsd \
156 vendor/tecnickcom/tcpdf/examples/ \
157 vendor/tecnickcom/tcpdf/tools/ \
158 vendor/tecnickcom/tcpdf/fonts/ae_fonts_*/ \
159 vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.*/ \
160 vendor/tecnickcom/tcpdf/fonts/freefont-*/ \
161 vendor/tecnickcom/tcpdf/include/sRGB.icc \
162 vendor/tecnickcom/tcpdf/.git \
163 vendor/tecnickcom/tcpdf/.github/ \
164 vendor/bacon/bacon-qr-code/phpunit.xml.dist \
165 vendor/bacon/bacon-qr-code/test/ \
166 vendor/dasprid/enum/phpunit.xml.dist \
167 vendor/dasprid/enum/test/ \
168 vendor/williamdes/mariadb-mysql-kbs/phpunit.xml \
169 vendor/williamdes/mariadb-mysql-kbs/test/ \
170 vendor/williamdes/mariadb-mysql-kbs/schemas/ \
171 vendor/williamdes/mariadb-mysql-kbs/dist/merged-raw.json \
172 vendor/williamdes/mariadb-mysql-kbs/dist/merged-raw.md \
173 vendor/williamdes/mariadb-mysql-kbs/dist/merged-slim.json \
174 vendor/williamdes/mariadb-mysql-kbs/dist/merged-ultraslim.php \
175 vendor/code-lts/u2f-php-server/phpunit.xml \
176 vendor/code-lts/u2f-php-server/test/ \
177 vendor/nikic/fast-route/.travis.yml \
178 vendor/nikic/fast-route/.hhconfig \
179 vendor/nikic/fast-route/FastRoute.hhi \
180 vendor/nikic/fast-route/phpunit.xml \
181 vendor/nikic/fast-route/psalm.xml \
182 vendor/nikic/fast-route/test/ \
183 vendor/twig/twig/doc/ \
184 vendor/twig/twig/test/ \
185 vendor/twig/twig/.github/ \
186 vendor/twig/twig/README.rst \
187 vendor/twig/twig/.travis.yml \
188 vendor/twig/twig/.editorconfig \
189 vendor/twig/twig/.php_cs.dist \
190 vendor/twig/twig/drupal_test.sh \
191 vendor/twig/twig/.php-cs-fixer.dist.php \
192 vendor/webmozart/assert/.editorconfig \
193 vendor/webmozart/assert/.github/ \
194 vendor/webmozart/assert/.php_cs \
195 vendor/webmozart/assert/psalm.xml \
196 vendor/twig/twig/src/Test/ \
197 vendor/psr/log/Psr/Log/Test/ \
198 vendor/psr/http-factory/.pullapprove.yml \
199 vendor/slim/psr7/MAINTAINERS.md \
200 vendor/paragonie/constant_time_encoding/tests/ \
201 vendor/paragonie/constant_time_encoding/psalm.xml \
202 vendor/paragonie/constant_time_encoding/phpunit.xml.dist \
203 vendor/paragonie/constant_time_encoding/.travis.yml \
204 vendor/pragmarx/google2fa/phpstan.neon \
205 vendor/pragmarx/google2fa-qrcode/.scrutinizer.yml \
206 vendor/pragmarx/google2fa-qrcode/.travis.yml \
207 vendor/pragmarx/google2fa-qrcode/phpunit.xml \
208 vendor/pragmarx/google2fa-qrcode/tests \
209 vendor/google/recaptcha/src/autoload.php \
210 vendor/google/recaptcha/app.yaml \
211 vendor/google/recaptcha/.travis.yml \
212 vendor/google/recaptcha/phpunit.xml.dist \
213 vendor/google/recaptcha/.github/ \
214 vendor/google/recaptcha/examples/ \
215 vendor/google/recaptcha/tests/
216 rm -rf \
217 vendor/google/recaptcha/ARCHITECTURE.md \
218 vendor/google/recaptcha/CONTRIBUTING.md \
219 vendor/phpmyadmin/motranslator/CODE_OF_CONDUCT.md \
220 vendor/phpmyadmin/motranslator/CONTRIBUTING.md \
221 vendor/phpmyadmin/motranslator/PERFORMANCE.md \
222 vendor/phpmyadmin/shapefile/CONTRIBUTING.md \
223 vendor/phpmyadmin/shapefile/CODE_OF_CONDUCT.md \
224 vendor/phpmyadmin/sql-parser/CODE_OF_CONDUCT.md \
225 vendor/phpmyadmin/sql-parser/CONTRIBUTING.md \
226 vendor/beberlei/assert/.github/ \
227 vendor/brick/math/SECURITY.md \
228 vendor/brick/math/psalm-baseline.xml \
229 vendor/brick/math/psalm.xml \
230 vendor/ramsey/collection/SECURITY.md \
231 vendor/spomky-labs/base64url/.github/ \
232 vendor/spomky-labs/cbor-php/.php_cs.dist \
233 vendor/spomky-labs/cbor-php/CODE_OF_CONDUCT.md \
234 vendor/spomky-labs/cbor-php/infection.json.dist \
235 vendor/spomky-labs/cbor-php/phpstan.neon \
236 vendor/thecodingmachine/safe/generated/Exceptions/.gitkeep \
237 vendor/thecodingmachine/safe/rector-migrate-0.7.php
238 find vendor/tecnickcom/tcpdf/fonts/ -maxdepth 1 -type f \
239 -not -name 'dejavusans.*' \
240 -not -name 'dejavusansb.*' \
241 -not -name 'helvetica.php' \
242 -print0 | xargs -0 rm
245 backup_vendor_folder() {
246 TEMP_FOLDER="$(mktemp -d /tmp/phpMyAdmin.XXXXXXXXX)"
247 cp -rp ./vendor "${TEMP_FOLDER}"
250 restore_vendor_folder() {
251 if [ ! -d ${TEMP_FOLDER} ]; then
252 echo 'No backup to restore'
253 exit 1;
255 rm -r ./vendor
256 mv "${TEMP_FOLDER}/vendor" ./vendor
257 rmdir "${TEMP_FOLDER}"
260 get_composer_package_version() {
261 awk '/require-dev/ {printline = 1; print; next } printline' composer.json | grep "$1" | awk -F [\"] '{print $4}'
264 create_phpunit_sandbox() {
265 PHPUNIT_VERSION="$(get_composer_package_version 'phpunit/phpunit')"
266 TEMP_PHPUNIT_FOLDER="$(mktemp -d /tmp/phpMyAdmin-phpunit.XXXXXXXXX)"
267 cd "${TEMP_PHPUNIT_FOLDER}"
268 composer require --no-interaction --dev "phpunit/phpunit:${PHPUNIT_VERSION}"
269 cd -
272 delete_phpunit_sandbox() {
273 if [ ! -d ${TEMP_PHPUNIT_FOLDER} ]; then
274 echo 'No phpunit sandbox to delete'
275 exit 1;
277 rm -r "${TEMP_PHPUNIT_FOLDER}"
280 security_checkup() {
281 if [ ! -f vendor/tecnickcom/tcpdf/tcpdf.php ]; then
282 echo 'TCPDF should be installed, detection failed !'
283 exit 1;
285 if [ ! -f vendor/web-auth/webauthn-lib/src/Server.php ]; then
286 echo 'Webauthn-lib should be installed, detection failed !'
287 exit 1;
289 if [ ! -f vendor/code-lts/u2f-php-server/src/U2FServer.php ]; then
290 echo 'U2F-server should be installed, detection failed !'
291 exit 1;
293 if [ ! -f vendor/pragmarx/google2fa-qrcode/src/Google2FA.php ]; then
294 echo 'Google 2FA should be installed, detection failed !'
295 exit 1;
299 autoload_checkup() {
300 php <<'CODE'
301 <?php
303 $classMapFiles = require __DIR__ . '/vendor/composer/autoload_classmap.php';
305 $foundFiles = 0;
306 $notFoundFiles = 0;
308 foreach ($classMapFiles as $classMapFile) {
309 if (! file_exists($classMapFile)) {
310 echo 'Does not exist: ' . $classMapFile . PHP_EOL;
311 $notFoundFiles++;
312 continue;
314 $foundFiles++;
317 echo '[autoload class map checkup] Found files: ' . $foundFiles . PHP_EOL;
318 echo '[autoload class map checkup] NOT found files: ' . $notFoundFiles . PHP_EOL;
319 $minFilesToHave = 1100;// An arbitrary value based on how many files the autoload has on average
321 if ($foundFiles < $minFilesToHave) {
322 echo '[autoload class map checkup] The project expects at least ' . $minFilesToHave . ' in the autoload class map' . PHP_EOL;
323 exit(1);
326 if ($notFoundFiles > 0) {
327 echo '[autoload class map checkup] There is some missing files documented in the class map' . PHP_EOL;
328 exit(1);
330 echo '[autoload class map checkup] The autoload class map seems okay' . PHP_EOL;
331 CODE
335 # Ensure we have tracking branch
336 ensure_local_branch $branch
338 VERSION_FILE=libraries/classes/Version.php
340 # Keep in sync with update-po script
341 fetchReleaseFromFile() {
342 php -r "define('VERSION_SUFFIX', ''); require_once('libraries/classes/Version.php'); echo \PhpMyAdmin\Version::VERSION;"
345 fetchVersionSeriesFromFile() {
346 php -r "define('VERSION_SUFFIX', ''); require_once('libraries/classes/Version.php'); echo \PhpMyAdmin\Version::SERIES;"
349 VERSION_SERIES_FROM_FILE="$(fetchVersionSeriesFromFile)"
351 if [ "${VERSION_SERIES_FROM_FILE}" != "${VERSION_SERIES}" ]; then
352 echo "This script can not handle ${VERSION_SERIES_FROM_FILE} version series."
353 echo "Only ${VERSION_SERIES} version series are allowed, please use your target branch directly or another branch."
354 echo "By changing branches you will have a release script that was designed for your version series."
355 exit 1;
358 echo "The actual configured release is: $(fetchReleaseFromFile)"
360 if [ $do_ci -eq 0 -a -$do_daily -eq 0 ] ; then
361 cat <<END
363 Please ensure you have incremented rc count or version in the repository :
364 - run ./scripts/console set-version $version
365 - in $VERSION_FILE Version class:
366 - check that VERSION, MAJOR, MINOR and PATCH are correct.
367 - in doc/conf.py the line
368 " version = '$version' "
369 - in README the "Version" line
370 - in package.json the line
371 " "version": "$version", "
372 - set release date in ChangeLog
374 Continue (y/n)?
376 read do_release
378 if [ "$do_release" != 'y' ]; then
379 exit 100
383 echo "The actual configured release is now: $(fetchReleaseFromFile)"
385 # Create working copy
386 mkdir -p release
387 git worktree prune
388 workdir=release/phpMyAdmin-$version
389 if [ -d $workdir ] ; then
390 echo "Working directory '$workdir' already exists, please move it out of way"
391 exit 1
394 # Add worktree with chosen branch
395 git worktree add --force $workdir $branch
396 cd $workdir
397 if [ $do_pull -eq 1 ] ; then
398 git pull -q
400 if [ $do_daily -eq 1 ] ; then
401 git_head=`git log -n 1 --format=%H`
402 git_head_short=`git log -n 1 --format=%h`
403 today_date=`date +'%Y%m%d' -u`
406 if [ $do_daily -eq 1 ] ; then
407 echo '* setting the version suffix for the snapshot'
408 sed -i "s/'versionSuffix' => '.*'/'versionSuffix' => '+$today_date.$git_head_short'/" libraries/vendor_config.php
409 php -l libraries/vendor_config.php
412 # Check release version
413 if [ $do_ci -eq 0 -a -$do_daily -eq 0 ] ; then
414 if ! grep -q "VERSION = '$version'" $VERSION_FILE ; then
415 echo "There seems to be wrong version in $VERSION_FILE!"
416 exit 2
418 if ! grep -q "version = '$version'" doc/conf.py ; then
419 echo "There seems to be wrong version in doc/conf.py"
420 exit 2
422 if ! grep -q "Version $version\$" README ; then
423 echo "There seems to be wrong version in README"
424 exit 2
426 if ! grep -q "\"version\": \"$version\"," package.json ; then
427 echo "There seems to be wrong version in package.json"
428 exit 2
432 # Cleanup release dir
433 LC_ALL=C date -u > RELEASE-DATE-${version}
435 # Building documentation
436 echo "* Generating documentation"
437 LC_ALL=C make -C doc html
438 find doc -name '*.pyc' -print0 | xargs -0 -r rm -f
440 # Check for gettext support
441 if [ -d po ] ; then
442 echo "* Generating mo files"
443 ./scripts/generate-mo
444 if [ -f ./scripts/remove-incomplete-mo ] ; then
445 echo "* Removing incomplete translations"
446 ./scripts/remove-incomplete-mo
450 if [ -f ./scripts/line-counts.sh ] ; then
451 echo "* Generating line counts"
452 ./scripts/line-counts.sh
455 echo "* Removing unneeded files"
457 # Remove developer information
458 rm -r .github CODE_OF_CONDUCT.md DCO
460 # Testsuite setup
461 rm .scrutinizer.yml .weblate codecov.yml
463 # Remove Doctum config file
464 rm test/doctum-config.php
466 # Remove readme for github
467 rm README.rst
469 if [ -f ./scripts/console ]; then
470 # Update the vendors to have the dev vendors
471 composer update --no-interaction
472 # Warm up the routing cache for 5.1+ releases
473 ./scripts/console cache:warmup --routing
476 PHP_REQ=$(sed -n '/"php"/ s/.*"\^\([0-9]\.[0-9]\.[0-9]\).*/\1/p' composer.json)
478 if [ -z "$PHP_REQ" ] ; then
479 echo "Failed to figure out required PHP version from composer.json"
480 exit 2
483 echo "* Writing the version to composer.json (version: $version)"
484 composer config version "$version"
486 # Okay, there is no way to tell composer to install
487 # suggested package. Let's require it and then revert
488 # composer.json to original state.
489 cp composer.json composer.json.backup
490 COMPOSER_VERSION="$(composer --version)"
491 echo "* Running composer (version: $COMPOSER_VERSION)"
492 composer config platform.php "$PHP_REQ"
493 composer update --no-interaction --no-dev
495 # Parse the required versions from composer.json
496 PACKAGES_VERSIONS=''
497 PACKAGE_LIST='tecnickcom/tcpdf pragmarx/google2fa-qrcode bacon/bacon-qr-code code-lts/u2f-php-server web-auth/webauthn-lib'
499 for PACKAGES in $PACKAGE_LIST
501 PKG_VERSION="$(get_composer_package_version "$PACKAGES")"
502 PACKAGES_VERSIONS="$PACKAGES_VERSIONS $PACKAGES:$PKG_VERSION"
503 done
505 echo "* Installing composer packages '$PACKAGES_VERSIONS'"
507 composer require --no-interaction --update-no-dev $PACKAGES_VERSIONS
509 echo "* Running a security checkup"
510 security_checkup
512 echo "* Cleaning up vendor folders"
513 mv composer.json.backup composer.json
514 cleanup_composer_vendors
516 echo "* Re-generating the autoload class map"
517 # https://getcomposer.org/doc/articles/autoloader-optimization.md#what-does-it-do-
518 # We removed some files, we also need that composer removes them from autoload class maps
519 # If the class is in the class map (as explained in the link above) then it is assumed to exist as a file
520 composer dump-autoload --no-interaction --optimize --dev
522 echo "* Running an autoload checkup"
523 autoload_checkup
525 echo "* Running a security checkup"
526 security_checkup
527 if [ $do_tag -eq 1 ] ; then
528 echo "* Commiting composer.lock"
529 git add --force composer.lock
530 git commit -s -m "Adding composer lock for $version"
533 if [ -f package.json ] ; then
534 echo "* Running Yarn"
535 yarn install --production
538 # Remove git metadata
539 rm .git
540 find . -name .gitignore -print0 | xargs -0 -r rm
541 find . -name .gitattributes -print0 | xargs -0 -r rm
543 if [ $do_test -eq 1 ] ; then
544 # Move the folder out and install dev vendors
545 create_phpunit_sandbox
546 # Backup the files because the new autoloader will change the composer vendor
547 backup_vendor_folder
548 # Generate an autoload for test class files (and include dev namespaces)
549 composer dump-autoload --dev || php -r "echo 'Requires: composer >= v2.1.2' . PHP_EOL; exit(1);"
550 "${TEMP_PHPUNIT_FOLDER}/vendor/bin/phpunit" --no-coverage --testsuite unit
551 test_ret=$?
552 if [ $do_ci -eq 1 ] ; then
553 cd ../..
554 rm -r $workdir
555 git worktree prune
556 if [ "$branch" = "ci" ] ; then
557 git branch -D ci
559 exit $test_ret
561 if [ $test_ret -ne 0 ] ; then
562 exit $test_ret
564 # Remove PHPUnit cache file
565 rm -f .phpunit.result.cache
566 # Generate an normal autoload (this is just a security, because normally the vendor folder will be restored)
567 composer dump-autoload
568 # Remove libs installed for testing
569 rm -r build
570 delete_phpunit_sandbox
571 restore_vendor_folder
574 security_checkup
576 cd ..
578 # Prepare all kits
579 for kit in $KITS ; do
580 echo "* Building kit: $kit"
581 # Copy all files
582 name=phpMyAdmin-$version-$kit
583 cp -r phpMyAdmin-$version $name
585 # Cleanup translations
586 cd phpMyAdmin-$version-$kit
587 ./scripts/lang-cleanup.sh $kit
589 # Remove tests, source code,...
590 if [ $kit != source ] ; then
591 echo "* Removing source files"
592 # Testsuite
593 rm -r test/
594 # Template test files
595 rm -r templates/test/
596 rm phpunit.xml.* build.xml
597 rm .editorconfig .browserslistrc .eslintignore .jshintrc .eslintrc.json .stylelintrc.json psalm.xml psalm-baseline.xml phpstan.neon.dist phpstan-baseline.neon phpcs.xml.dist jest.config.cjs infection.json.dist
598 # Gettext po files (if they where not removed by ./scripts/lang-cleanup.sh)
599 rm -rf po
600 # Documentation source code
601 mv doc/html htmldoc
602 rm -r doc
603 mkdir doc
604 mv htmldoc doc/html
605 rm doc/html/.buildinfo doc/html/objects.inv
606 rm -r node_modules
607 # Remove bin files for non source version
608 # https://github.com/phpmyadmin/phpmyadmin/issues/16033
609 rm -r vendor/bin
612 # Remove developer scripts
613 rm -r scripts
615 # Remove possible tmp folder
616 rm -rf tmp
618 cd ..
620 # Remove tar file possibly left from previous run
621 rm -f $name.tar
623 # Prepare distributions
624 for comp in $COMPRESSIONS ; do
625 case $comp in
626 tbz|tgz|txz)
627 if [ ! -f $name.tar ] ; then
628 echo "* Creating $name.tar"
629 tar --owner=root --group=root --numeric-owner --sort=name -cf $name.tar $name
631 if [ $comp = txz ] ; then
632 echo "* Creating $name.tar.xz"
633 xz -9k $name.tar
635 if [ $comp = tgz ] ; then
636 echo "* Creating $name.tar.gz"
637 gzip -9c $name.tar > $name.tar.gz
640 zip-7z)
641 echo "* Creating $name.zip"
642 7za a -bd -tzip $name.zip $name > /dev/null
645 echo "WARNING: ignoring compression '$comp', not known!"
647 esac
648 done
651 # Cleanup
652 rm -f $name.tar
653 # Remove directory with current dist set
654 rm -r $name
655 done
657 # Cleanup
658 rm -r phpMyAdmin-${version}
659 git worktree prune
661 # Signing of files with default GPG key
662 echo "* Signing files"
663 for file in phpMyAdmin-$version-*.gz phpMyAdmin-$version-*.zip phpMyAdmin-$version-*.xz ; do
664 if [ $do_sign -eq 1 ] ; then
665 gpg --detach-sign --armor $file
667 sha1sum $file > $file.sha1
668 sha256sum $file > $file.sha256
669 done
671 if [ $do_daily -eq 1 ] ; then
672 cat > phpMyAdmin-${version}.json << EOT
674 "date": "`date --iso-8601=seconds`",
675 "commit": "$git_head"
678 exit 0
682 echo ""
683 echo ""
684 echo ""
685 echo "Files:"
686 echo "------"
688 ls -la *.gz *.zip *.xz
690 cd ..
692 # Tag as release
693 if [ $do_tag -eq 1 ] ; then
694 echo
695 echo "Additional tasks:"
696 tagname=RELEASE_`echo $version | tr . _ | tr '[:lower:]' '[:upper:]' | tr -d -`
697 echo "* Tagging release as $tagname"
698 git tag -s -a -m "Released $version" $tagname $branch
699 echo " Dont forget to push tags using: git push --tags"
700 echo "* Cleanup of $branch"
701 # Remove composer.lock, but we need to create fresh worktree for that
702 git worktree add --force $workdir $branch
703 cd $workdir
704 git rm --force composer.lock
705 git commit -s -m "Removing composer.lock"
706 cd ../..
707 rm -r $workdir
708 git worktree prune
711 # Mark as stable release
712 if [ $do_stable -eq 1 ] ; then
713 mark_as_release $branch STABLE
716 cat <<END
719 Todo now:
720 ---------
722 1. Push the new tag upstream, with a command like git push origin --tags
724 2. Push the new STABLE branch upstream
726 3. prepare a release/phpMyAdmin-$version-notes.html explaining in short the goal of
727 this release and paste into it the ChangeLog for this release, followed
728 by the notes of all previous incremental versions (i.e. 4.4.9 through 4.4.0)
730 4. upload the files to our file server, use scripts/upload-release, eg.:
732 ./scripts/upload-release $version release
734 5. 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/
736 6. send a short mail (with list of major changes) to
737 developers@phpmyadmin.net
738 news@phpmyadmin.net
740 Don't forget to update the Description section in the announcement,
741 based on documentation.
743 7. increment rc count or version in the repository :
744 - run ./scripts/console set-version $version
745 - in $VERSION_FILE Version class:
746 - check that VERSION, MAJOR, MINOR and PATCH are correct.
747 - in README the "Version" line
748 " Version 2.7.1-dev "
749 - in package.json the line
750 " "version": " 2.7.1-dev", "
751 - in doc/conf.py (if it exists) the line
752 " version = '2.7.1-dev' "
754 8. 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
756 9. for a major release, update demo/php/versions.ini in the scripts repository so that the demo server shows current versions
758 10. 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
760 11. update the Dockerfile in the docker repository to reflect the new version and create a new annotated tag (such as with git tag -s -a 4.7.9-1 -m "Version 4.7.9-1"). Remember to push the tag with git push origin {tagName}