Skip to content

Commit

Permalink
Merge pull request #25 from jakzal/bugfix/phar-version
Browse files Browse the repository at this point in the history
Read tag from the TRAVIS_TAG env variable instead of git
  • Loading branch information
jakzal authored Jan 2, 2019
2 parents 22a3f3a + c349061 commit 31bd807
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ matrix:
fast_finish: true
before_install:
- phpenv config-rm xdebug.ini || echo "XDebug is not enabled"
- export TOOLBOX_VERSION=$(echo ${TRAVIS_TAG:-"dev"} | sed -e 's/^v//')
install:
- if [[ $deps = low ]]; then make update-min; else make install; fi
script:
Expand Down
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
default: build

PHP_VERSION:=$(shell php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')
TOOLBOX_VERSION?=dev

build: install test
.PHONY: build
Expand Down Expand Up @@ -62,11 +63,10 @@ phpunit-coverage: tools/phpunit
.PHONY: phpunit

package: tools/box
$(eval VERSION=$(shell (git describe --abbrev=0 --tags 2>/dev/null || echo "0.1-dev") | sed -e 's/^v//'))
@rm -rf build/phar && mkdir -p build/phar build/phar/bin

cp -r resources src LICENSE composer.json scoper.inc.php build/phar
sed -e 's/Application('"'"'dev/Application('"'"'$(VERSION)/g' bin/toolbox.php > build/phar/bin/toolbox.php
sed -e 's/Application('"'"'dev/Application('"'"'$(TOOLBOX_VERSION)/g' bin/toolbox.php > build/phar/bin/toolbox.php

cd build/phar && \
composer config platform.php 7.1.3 && \
Expand All @@ -78,12 +78,11 @@ package: tools/box
.PHONY: package

package-devkit: tools/box
$(eval VERSION=$(shell (git describe --abbrev=0 --tags 2>/dev/null || echo "0.1-dev") | sed -e 's/^v//'))
@rm -rf build/devkit-phar && mkdir -p build/devkit-phar build/devkit-phar/bin build/devkit-phar/src

cp -r resources LICENSE composer.json scoper.inc.php build/devkit-phar
cp -r src/Json src/Runner src/Tool build/devkit-phar/src
sed -e 's/\(Application(.*\)'"'"'dev/\1'"'"'$(VERSION)/g' bin/devkit.php > build/devkit-phar/bin/devkit.php
sed -e 's/\(Application(.*\)'"'"'dev/\1'"'"'$(TOOLBOX_VERSION)/g' bin/devkit.php > build/devkit-phar/bin/devkit.php

cd build/devkit-phar && \
composer config platform.php 7.1.3 && \
Expand Down

0 comments on commit 31bd807

Please sign in to comment.