forked from coenjacobs/mozart
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into DIRECTORY_SEPARAT…
…OR-and-its-duplicates
- Loading branch information
Showing
8 changed files
with
127 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,46 @@ | ||
name: Publish release to Docker Hub | ||
name: Build, tag and attach releases | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*.*.*" | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
create-phar: | ||
runs-on: ubuntu-latest | ||
name: Create Mozart phar | ||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Install PHP | ||
uses: shivammathur/[email protected] | ||
with: | ||
php-version: 7.3 | ||
|
||
- name: Install dependencies | ||
run: composer install --no-dev --prefer-dist --no-suggest --no-progress | ||
|
||
- name: Create .phar | ||
run: | | ||
wget -O phar-composer.phar https://github.com/clue/phar-composer/releases/download/v1.2.0/phar-composer-1.2.0.phar | ||
mkdir build | ||
mv vendor build/vendor | ||
mv src build/src | ||
mv bin build/bin | ||
mv composer.json build | ||
php -d phar.readonly=off phar-composer.phar build ./build/ | ||
- name: Test run mozart | ||
run: php mozart.phar --version | ||
|
||
- uses: meeDamian/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
files: mozart.phar | ||
gzip: false | ||
allow_override: true | ||
docker: | ||
runs-on: ubuntu-latest | ||
name: Create Docker tag | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
@@ -16,14 +49,8 @@ jobs: | |
id: prep | ||
run: | | ||
DOCKER_IMAGE=coenjacobs/mozart | ||
VERSION=latest | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
VERSION=${GITHUB_REF#refs/tags/v} | ||
fi | ||
VERSION=${{ github.event.release.tag_name }} | ||
TAGS="${DOCKER_IMAGE}:${VERSION}" | ||
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then | ||
TAGS="$TAGS,${DOCKER_IMAGE}:latest" | ||
fi | ||
echo ::set-output name=tags::${TAGS} | ||
- name: Set up QEMU | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,29 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
call_user_func(function ($version) { | ||
if (is_file($autoload = getcwd() . '/vendor/autoload.php')) { | ||
require $autoload; | ||
} elseif (is_file($autoload = getcwd() . '/../../autoload.php')) { | ||
require $autoload; | ||
} | ||
if( ! Phar::running() ) { | ||
if (is_file($autoload = getcwd() . '/vendor/autoload.php')) { | ||
require $autoload; | ||
} elseif (is_file($autoload = getcwd() . '/../../autoload.php')) { | ||
require $autoload; | ||
} | ||
|
||
if (is_file($autoload = __DIR__ . '/../vendor/autoload.php')) { | ||
require($autoload); | ||
} elseif (is_file($autoload = __DIR__ . '/../../../autoload.php')) { | ||
require($autoload); | ||
} else { | ||
fwrite(STDERR, | ||
'You must set up the project dependencies, run the following commands:' . PHP_EOL . | ||
'curl -s http://getcomposer.org/installer | php' . PHP_EOL . | ||
'php composer.phar install' . PHP_EOL | ||
); | ||
exit(1); | ||
if ( is_file( $autoload = __DIR__ . '/../vendor/autoload.php' ) ) { | ||
require( $autoload ); | ||
} elseif ( is_file( $autoload = __DIR__ . '/../../../autoload.php' ) ) { | ||
require( $autoload ); | ||
} else { | ||
fwrite( STDERR, | ||
'You must set up the project dependencies, run the following commands:' . PHP_EOL . | ||
'curl -s http://getcomposer.org/installer | php' . PHP_EOL . | ||
'php composer.phar install' . PHP_EOL | ||
); | ||
exit( 1 ); | ||
} | ||
} else { | ||
include 'phar://mozart.phar/vendor/autoload.php'; | ||
} | ||
|
||
$app = new CoenJacobs\Mozart\Console\Application($version); | ||
$app->run(); | ||
}, '0.7.0'); | ||
}, '0.8.0'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters