-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
63 additions
and
42 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,42 +1,63 @@ | ||
on: push | ||
name: Release workflow | ||
jobs: | ||
build-phar: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@master | ||
with: | ||
php-version: 7.4 | ||
ini-values: memory_limit=2G, display_errors=On, error_reporting=-1, phar.readonly=0 | ||
tools: pecl, phive | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache composer dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: composer- | ||
|
||
- name: Install Composer dependencies | ||
run: | | ||
composer install --no-progress --prefer-dist --optimize-autoloader | ||
- name: Install phive tools | ||
run: phive install --trust-gpg-keys 2A8299CE842DD38C | ||
|
||
- name: Create build dir | ||
run: make phar | ||
|
||
- name: Upload PHAR file | ||
uses: actions/[email protected] | ||
with: | ||
name: prophecy-phpunit.phar | ||
path: build/prophecy-phpunit.phar | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
name: Release workflow | ||
jobs: | ||
build-phar: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 7.3 | ||
ini-values: memory_limit=2G, display_errors=On, error_reporting=-1, phar.readonly=0 | ||
tools: phive | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache composer dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: composer- | ||
|
||
- name: Install Composer dependencies | ||
run: | | ||
composer install --no-dev --no-progress --prefer-dist --optimize-autoloader | ||
- name: Remove phpunit | ||
run: composer remove phpunit/phpunit | ||
|
||
- name: Install phive tools | ||
run: phive install --trust-gpg-keys 2A8299CE842DD38C | ||
|
||
- name: Build phar | ||
run: make phar | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./build/prophecy-phpunit.phar | ||
asset_name: prophecy-phpunit.phar | ||
asset_content_type: application/zip |