From eee724cf8366c85ca33d7a2d9fec8ddc428fed6c Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 1 Mar 2018 23:50:55 +0000 Subject: [PATCH] Create different phars for development branches --- tests/makephar.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/makephar.sh b/tests/makephar.sh index fe3f806b..bf966b24 100755 --- a/tests/makephar.sh +++ b/tests/makephar.sh @@ -4,6 +4,7 @@ composer global require spatie/7to5 [ -f $HOME/.composer/vendor/bin/php7to5 ] && php7to5=$HOME/.composer/vendor/bin/php7to5 [ -f $HOME/.config/composer/vendor/bin/php7to5 ] && php7to5=$HOME/.config/composer/vendor/bin/php7to5 + rm -rf phar7 phar5 MadelineProtoPhar mkdir phar7 @@ -12,7 +13,7 @@ echo '{ "name": "danog/madelineprototests", "minimum-stability":"dev", "require": { - "danog/madelineproto": "dev-master#'$TRAVIS_COMMIT'" + "danog/madelineproto": "dev-'$TRAVIS_BRANCH'#'$TRAVIS_COMMIT'" }, "repositories": [ { @@ -32,7 +33,9 @@ cd .. $php7to5 convert --copy-all phar7 phar5 >/dev/null -php makephar.php phar5 madeline.phar $TRAVIS_COMMIT +[ "$TRAVIS_BRANCH" != "master" ] && branch="-$TRAVIS_BRANCH" || branch="" + +php makephar.php phar5 "madeline$branch.phar" $TRAVIS_COMMIT eval "$(ssh-agent -s)" echo -e "$private_key" > madeline_rsa @@ -40,7 +43,7 @@ chmod 600 madeline_rsa ssh-add madeline_rsa git clone git@github.com:danog/MadelineProtoPhar cd MadelineProtoPhar -cp ../madeline.phar . +cp "../madeline$branch.phar" . cp ../phar.php . echo -n $TRAVIS_COMMIT > release git add -A @@ -56,6 +59,4 @@ for chat_id in $destinations;do $TRAVIS_COMMIT_MESSAGE" -F parse_mode="HTML" -F chat_id=$chat_id | JSON.sh/JSON.sh -s | egrep '\["result","message_id"\]' | cut -f 2 | cut -d '"' -f 2) - #echo "$TRAVIS_COMMIT_MESSAGE" | grep -q release_phar && curl -s https://api.telegram.org/bot$token/sendDocument -F caption="md5: $(md5sum madeline.phar | sed 's/\s.*//g') -#commit: $TRAVIS_COMMIT" -F chat_id=$chat_id -F document=@madeline.phar -F reply_to_message_id=$ID done