Skip to content

Commit 670c3ee

Browse files
authored
Auto-building PHAR file (#7)
* Building phar file * Tests for phar file * Upload phar file on each new tag * Updated Readme
1 parent 12e3984 commit 670c3ee

File tree

10 files changed

+5663
-60
lines changed

10 files changed

+5663
-60
lines changed

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,16 @@
1111
# @link https://github.com/JBZoo/Composer-Diff
1212
#
1313

14+
/.github export-ignore
15+
/.phan export-ignore
16+
/build export-ignore
17+
/resources export-ignore
18+
/tests export-ignore
19+
/.editorconfig export-ignore
20+
/.gitattributes export-ignore
21+
/.gitignore export-ignore
22+
/.travis.yml export-ignore
23+
/phpunit.xml.dist export-ignore
24+
1425
* text eol=lf
1526
*.png binary

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@
1616
build
1717
vendor
1818
phpunit.xml
19-
composer.lock
2019
*.cache

.travis.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,32 @@ php:
1919
- 7.2
2020
- 7.3
2121
- 7.4
22+
- 8.0
23+
- nightly
2224

23-
env:
24-
matrix:
25-
- JBZOO_COMPOSER_UPDATE_FLAGS="--prefer-lowest --prefer-stable"
26-
- JBZOO_COMPOSER_UPDATE_FLAGS=""
25+
jobs:
26+
fast_finish: true
27+
allow_failures:
28+
- php: 8.0
29+
- php: nightly
2730

2831
before_script:
2932
- composer self-update
3033

3134
script:
32-
- make update --no-print-directory
35+
- make build --no-print-directory
3336
- make test-all --no-print-directory
3437

3538
after_script:
3639
- make report-coveralls
40+
41+
deploy:
42+
provider: releases
43+
token:
44+
secure: QzCyIZJGe2dFyVRfKjS6rC2Y1i1mC44zt6rcBlmGojEfuM8J/VSe5v2PrS+yra6f98hDc+JDfuPL2x/FFYoNkiRXOyDLlcvXElfoByeC87KMxrzhjeBzFiknbW/AfvnpngxE4qGX+jN488IV4lVNseNHGPEYQadMHHen0Wu4aPuCyv7Y5oXUlG0rlZhUFoGsY3ZTnbtqcrXrHJMl9lsx23IcPbUtCzm1m51PgIFsISLEximnSrKXeQSdOAWDUH/YC4zA9GfuaIPbLrIyKdA0hsZm+H4VnfpeoqksyyHBdn8Pt+mC/HIB5QcqjxWO7dzQ0sVV8nS6zkztR17JfgAuUUsxIq5wGM2hWEdA6bQqb+7AAknRX/d+us++f2gJzgL06tm+xRF+XMVY2Up3KCk6HHXgOSEybNZE5nufOlBcZfTSRs7HY1Mju3dTCSY0mKgQvJaD6IWM29qBGU/9d+GXn2nSQIP23ste+a0mmQQx3JEhvrGeIApWaVX4Cfzxbj219T2C2ErMimOE/UpRlp1iN4kMggjCk2rJvL4rCs8gbNZGj97cHXE3qWel2p7DsvIrZhcZOr6DS5B1xRe1a8Wai+kKlZb7A00ArtON8ZDHNP9Xa9Wpsu0kNg78rkFhYEoZFKr6RNTL4rAdaIKGOYVN2ygjlXHSBv4RD9mBOtBLJk4=
45+
file: "./build/composer-diff.phar"
46+
skip_cleanup: true
47+
on:
48+
tags: true
49+
branch: master
50+
php: 7.2

Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,24 @@
1111
# @link https://github.com/JBZoo/Composer-Diff
1212
#
1313

14+
.PHONY: build
1415

1516
ifneq (, $(wildcard ./vendor/jbzoo/codestyle/src/init.Makefile))
1617
include ./vendor/jbzoo/codestyle/src/init.Makefile
1718
endif
1819

1920

21+
build: ##@Project Install all 3rd party dependencies
22+
$(call title,"Install/Update all 3rd party dependencies")
23+
@composer install --optimize-autoloader --no-progress
24+
@make build-phar
25+
26+
2027
update: ##@Project Install/Update all 3rd party dependencies
2128
$(call title,"Install/Update all 3rd party dependencies")
22-
@echo "Composer flags: $(JBZOO_COMPOSER_UPDATE_FLAGS)"
23-
@composer update $(JBZOO_COMPOSER_UPDATE_FLAGS)
29+
@composer update --optimize-autoloader --no-progress
30+
$(call title,"Show difference in composer.lock")
31+
@$(PHP_BIN) composer-diff
2432

2533

2634
test-all: ##@Project Run all project tests at once

README.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,37 @@
55

66

77

8-
See what packages have changed after you run `composer update` by comparing `composer.lock` to the `git show HEAD:composer.lock`.
8+
See what packages have been changed after you run `composer update` by comparing `composer.lock` to the `git show HEAD:composer.lock`.
99

1010

1111
## Installation
1212

13-
```
13+
```shell
1414
composer require jbzoo/composer-diff # For specific project
1515
composer global require jbzoo/composer-diff # As global tool
16+
17+
# OR use phar file.
18+
# Replace <VERSION> to the latest version. See releases page or badge above
19+
wget https://github.com/JBZoo/Composer-Diff/releases/download/<VERSION>/composer-diff.phar
1620
```
1721

1822
## Usage
1923

2024
```bash
2125
composer update
22-
# don't commit yet!
23-
php ./vendor/bin/composer-diff # or just `composer-diff` if installed globally
26+
27+
# if it's installed via composer
28+
php ./vendor/bin/composer-diff
29+
30+
# OR (if installed globally)
31+
composer-diff
32+
33+
# OR (if you downloaded phar file)
34+
php composer-diff.phar
2435
```
2536

37+
38+
## Help Description
2639
```
2740
./vendor/bin/composer-diff --help
2841
@@ -169,14 +182,14 @@ Rendered in your readme or PR/MR description:
169182
* [ ] Supporting Drupal repos. [For example](https://git.drupalcode.org/project/fast_404).
170183
* [ ] Add action in the composer via API like `composer lock-diff`.
171184
* [ ] Fixes [the same issue](https://github.com/davidrjonas/composer-lock-diff/issues/26) with complex/custom name of tag.
172-
* [ ] Auto detecting alias name of branch.
173-
* [ ] No warp links for markdown format.
185+
* [ ] Auto-detecting alias name of branch.
186+
* [ ] No warp links for Markdown format.
174187
* [ ] (?) Support MS Windows...
175188

176189

177190
## Unit tests and check code style
178191
```sh
179-
make update
192+
make build
180193
make test-all
181194
```
182195

box.json.dist

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"banner" : [
3+
"JBZoo Toolbox - Composer-Diff",
4+
"",
5+
"This file is part of the JBZoo Toolbox project.",
6+
"For the full copyright and license information, please view the LICENSE",
7+
"file that was distributed with this source code.",
8+
"",
9+
"@package Composer-Diff",
10+
"@license MIT",
11+
"@copyright Copyright (C) JBZoo.com, All rights reserved.",
12+
"@link https://github.com/JBZoo/Composer-Diff"
13+
],
14+
15+
"output" : "build/composer-diff.phar",
16+
17+
"directories" : ["src"],
18+
"files" : ["composer-diff.php"],
19+
"git-version" : "git-version",
20+
21+
"finder" : [
22+
{
23+
"in" : "vendor",
24+
"name" : "*.php",
25+
"exclude" : ["Tests", "tests", "test"]
26+
}
27+
]
28+
}

composer.json

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"name" : "jbzoo/composer-diff",
3-
"type" : "library",
4-
"description" : "See what has changed after a composer update.",
5-
"keywords" : ["composer", "php", "composer.lock", "composer.json"],
6-
"license" : "MIT",
2+
"name" : "jbzoo/composer-diff",
3+
"type" : "library",
4+
"description" : "See what has changed after a composer update.",
5+
"keywords" : ["composer", "php", "composer.lock", "composer.json", "diff", "composer diff", "composer-diff"],
6+
"license" : "MIT",
77

8-
"authors" : [
8+
"authors" : [
99
{
1010
"name" : "Denis Smetannikov",
1111
"email" : "[email protected]",
@@ -18,7 +18,7 @@
1818
}
1919
],
2020

21-
"require" : {
21+
"require" : {
2222
"php" : ">=7.2",
2323
"ext-json" : "*",
2424
"ext-filter" : "*",
@@ -29,33 +29,35 @@
2929
"composer/semver" : ">=1.0"
3030
},
3131

32-
"require-dev" : {
32+
"require-dev" : {
3333
"jbzoo/utils" : "^4.2.3",
3434
"jbzoo/phpunit" : "^4.6.2",
3535
"jbzoo/codestyle" : "^2.10.0",
3636
"jbzoo/toolbox-ci" : "^1.3.5",
3737
"symfony/var-dumper" : "^4.4|^5.2.5",
38-
"php-coveralls/php-coveralls" : "^2.4.3"
38+
"php-coveralls/php-coveralls" : "^2.4.3",
39+
"roave/security-advisories" : "dev-master"
3940
},
4041

41-
"autoload" : {
42+
"autoload" : {
4243
"psr-4" : {
4344
"JBZoo\\ComposerDiff\\" : "src"
4445
}
4546
},
4647

47-
"autoload-dev" : {
48+
"autoload-dev" : {
4849
"classmap" : ["tests"]
4950
},
5051

51-
"bin" : ["composer-diff"],
52-
"minimum-stability" : "dev",
53-
"prefer-stable" : true,
54-
"config" : {
55-
"optimize-autoloader" : true
52+
"bin" : ["composer-diff"],
53+
"config" : {
54+
"optimize-autoloader" : true,
55+
"platform" : {
56+
"php" : "7.2"
57+
}
5658
},
5759

58-
"extra" : {
60+
"extra" : {
5961
"branch-alias" : {
6062
"dev-master" : "1.x-dev"
6163
}

0 commit comments

Comments
 (0)