Skip to content

Commit

Permalink
Auto-building PHAR file (#7)
Browse files Browse the repository at this point in the history
* Building phar file
* Tests for phar file
* Upload phar file on each new tag
* Updated Readme
  • Loading branch information
SmetDenis authored Apr 19, 2021
1 parent 12e3984 commit 670c3ee
Show file tree
Hide file tree
Showing 10 changed files with 5,663 additions and 60 deletions.
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,16 @@
# @link https://github.com/JBZoo/Composer-Diff
#

/.github export-ignore
/.phan export-ignore
/build export-ignore
/resources export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore

* text eol=lf
*.png binary
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@
build
vendor
phpunit.xml
composer.lock
*.cache
24 changes: 19 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,32 @@ php:
- 7.2
- 7.3
- 7.4
- 8.0
- nightly

env:
matrix:
- JBZOO_COMPOSER_UPDATE_FLAGS="--prefer-lowest --prefer-stable"
- JBZOO_COMPOSER_UPDATE_FLAGS=""
jobs:
fast_finish: true
allow_failures:
- php: 8.0
- php: nightly

before_script:
- composer self-update

script:
- make update --no-print-directory
- make build --no-print-directory
- make test-all --no-print-directory

after_script:
- make report-coveralls

deploy:
provider: releases
token:
secure: QzCyIZJGe2dFyVRfKjS6rC2Y1i1mC44zt6rcBlmGojEfuM8J/VSe5v2PrS+yra6f98hDc+JDfuPL2x/FFYoNkiRXOyDLlcvXElfoByeC87KMxrzhjeBzFiknbW/AfvnpngxE4qGX+jN488IV4lVNseNHGPEYQadMHHen0Wu4aPuCyv7Y5oXUlG0rlZhUFoGsY3ZTnbtqcrXrHJMl9lsx23IcPbUtCzm1m51PgIFsISLEximnSrKXeQSdOAWDUH/YC4zA9GfuaIPbLrIyKdA0hsZm+H4VnfpeoqksyyHBdn8Pt+mC/HIB5QcqjxWO7dzQ0sVV8nS6zkztR17JfgAuUUsxIq5wGM2hWEdA6bQqb+7AAknRX/d+us++f2gJzgL06tm+xRF+XMVY2Up3KCk6HHXgOSEybNZE5nufOlBcZfTSRs7HY1Mju3dTCSY0mKgQvJaD6IWM29qBGU/9d+GXn2nSQIP23ste+a0mmQQx3JEhvrGeIApWaVX4Cfzxbj219T2C2ErMimOE/UpRlp1iN4kMggjCk2rJvL4rCs8gbNZGj97cHXE3qWel2p7DsvIrZhcZOr6DS5B1xRe1a8Wai+kKlZb7A00ArtON8ZDHNP9Xa9Wpsu0kNg78rkFhYEoZFKr6RNTL4rAdaIKGOYVN2ygjlXHSBv4RD9mBOtBLJk4=
file: "./build/composer-diff.phar"
skip_cleanup: true
on:
tags: true
branch: master
php: 7.2
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,24 @@
# @link https://github.com/JBZoo/Composer-Diff
#

.PHONY: build

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


build: ##@Project Install all 3rd party dependencies
$(call title,"Install/Update all 3rd party dependencies")
@composer install --optimize-autoloader --no-progress
@make build-phar


update: ##@Project Install/Update all 3rd party dependencies
$(call title,"Install/Update all 3rd party dependencies")
@echo "Composer flags: $(JBZOO_COMPOSER_UPDATE_FLAGS)"
@composer update $(JBZOO_COMPOSER_UPDATE_FLAGS)
@composer update --optimize-autoloader --no-progress
$(call title,"Show difference in composer.lock")
@$(PHP_BIN) composer-diff


test-all: ##@Project Run all project tests at once
Expand Down
27 changes: 20 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,37 @@



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


## Installation

```
```shell
composer require jbzoo/composer-diff # For specific project
composer global require jbzoo/composer-diff # As global tool

# OR use phar file.
# Replace <VERSION> to the latest version. See releases page or badge above
wget https://github.com/JBZoo/Composer-Diff/releases/download/<VERSION>/composer-diff.phar
```

## Usage

```bash
composer update
# don't commit yet!
php ./vendor/bin/composer-diff # or just `composer-diff` if installed globally

# if it's installed via composer
php ./vendor/bin/composer-diff

# OR (if installed globally)
composer-diff

# OR (if you downloaded phar file)
php composer-diff.phar
```


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


## Unit tests and check code style
```sh
make update
make build
make test-all
```

Expand Down
28 changes: 28 additions & 0 deletions box.json.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"banner" : [
"JBZoo Toolbox - Composer-Diff",
"",
"This file is part of the JBZoo Toolbox project.",
"For the full copyright and license information, please view the LICENSE",
"file that was distributed with this source code.",
"",
"@package Composer-Diff",
"@license MIT",
"@copyright Copyright (C) JBZoo.com, All rights reserved.",
"@link https://github.com/JBZoo/Composer-Diff"
],

"output" : "build/composer-diff.phar",

"directories" : ["src"],
"files" : ["composer-diff.php"],
"git-version" : "git-version",

"finder" : [
{
"in" : "vendor",
"name" : "*.php",
"exclude" : ["Tests", "tests", "test"]
}
]
}
36 changes: 19 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name" : "jbzoo/composer-diff",
"type" : "library",
"description" : "See what has changed after a composer update.",
"keywords" : ["composer", "php", "composer.lock", "composer.json"],
"license" : "MIT",
"name" : "jbzoo/composer-diff",
"type" : "library",
"description" : "See what has changed after a composer update.",
"keywords" : ["composer", "php", "composer.lock", "composer.json", "diff", "composer diff", "composer-diff"],
"license" : "MIT",

"authors" : [
"authors" : [
{
"name" : "Denis Smetannikov",
"email" : "[email protected]",
Expand All @@ -18,7 +18,7 @@
}
],

"require" : {
"require" : {
"php" : ">=7.2",
"ext-json" : "*",
"ext-filter" : "*",
Expand All @@ -29,33 +29,35 @@
"composer/semver" : ">=1.0"
},

"require-dev" : {
"require-dev" : {
"jbzoo/utils" : "^4.2.3",
"jbzoo/phpunit" : "^4.6.2",
"jbzoo/codestyle" : "^2.10.0",
"jbzoo/toolbox-ci" : "^1.3.5",
"symfony/var-dumper" : "^4.4|^5.2.5",
"php-coveralls/php-coveralls" : "^2.4.3"
"php-coveralls/php-coveralls" : "^2.4.3",
"roave/security-advisories" : "dev-master"
},

"autoload" : {
"autoload" : {
"psr-4" : {
"JBZoo\\ComposerDiff\\" : "src"
}
},

"autoload-dev" : {
"autoload-dev" : {
"classmap" : ["tests"]
},

"bin" : ["composer-diff"],
"minimum-stability" : "dev",
"prefer-stable" : true,
"config" : {
"optimize-autoloader" : true
"bin" : ["composer-diff"],
"config" : {
"optimize-autoloader" : true,
"platform" : {
"php" : "7.2"
}
},

"extra" : {
"extra" : {
"branch-alias" : {
"dev-master" : "1.x-dev"
}
Expand Down
Loading

0 comments on commit 670c3ee

Please sign in to comment.