|
1 | | - on: push |
2 | | - name: Release workflow |
3 | | - jobs: |
4 | | - build-phar: |
5 | | - runs-on: ubuntu-latest |
6 | | - steps: |
7 | | - - uses: actions/checkout@master |
8 | | - |
9 | | - - name: Setup PHP |
10 | | - uses: shivammathur/setup-php@master |
11 | | - with: |
12 | | - php-version: 7.4 |
13 | | - ini-values: memory_limit=2G, display_errors=On, error_reporting=-1, phar.readonly=0 |
14 | | - tools: pecl, phive |
15 | | - |
16 | | - - name: Get composer cache directory |
17 | | - id: composer-cache |
18 | | - run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
19 | | - |
20 | | - - name: Cache composer dependencies |
21 | | - uses: actions/cache@v2 |
22 | | - with: |
23 | | - path: ${{ steps.composer-cache.outputs.dir }} |
24 | | - key: composer-${{ hashFiles('**/composer.lock') }} |
25 | | - restore-keys: composer- |
26 | | - |
27 | | - - name: Install Composer dependencies |
28 | | - run: | |
29 | | - composer install --no-progress --prefer-dist --optimize-autoloader |
30 | | -
|
31 | | - - name: Install phive tools |
32 | | - run: phive install --trust-gpg-keys 2A8299CE842DD38C |
33 | | - |
34 | | - - name: Create build dir |
35 | | - run: make phar |
36 | | - |
37 | | - - name: Upload PHAR file |
38 | | - |
39 | | - with: |
40 | | - name: prophecy-phpunit.phar |
41 | | - path: build/prophecy-phpunit.phar |
42 | | - |
| 1 | +on: |
| 2 | + push: |
| 3 | + tags: |
| 4 | + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 |
| 5 | +name: Release workflow |
| 6 | +jobs: |
| 7 | + build-phar: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + steps: |
| 10 | + - uses: actions/checkout@v2 |
| 11 | + |
| 12 | + - name: Setup PHP |
| 13 | + uses: shivammathur/setup-php@v2 |
| 14 | + with: |
| 15 | + php-version: 7.3 |
| 16 | + ini-values: memory_limit=2G, display_errors=On, error_reporting=-1, phar.readonly=0 |
| 17 | + tools: phive |
| 18 | + |
| 19 | + - name: Get composer cache directory |
| 20 | + id: composer-cache |
| 21 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 22 | + |
| 23 | + - name: Cache composer dependencies |
| 24 | + uses: actions/cache@v2 |
| 25 | + with: |
| 26 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 27 | + key: composer-${{ hashFiles('**/composer.lock') }} |
| 28 | + restore-keys: composer- |
| 29 | + |
| 30 | + - name: Install Composer dependencies |
| 31 | + run: | |
| 32 | + composer install --no-dev --no-progress --prefer-dist --optimize-autoloader |
| 33 | +
|
| 34 | + - name: Remove phpunit |
| 35 | + run: composer remove phpunit/phpunit |
| 36 | + |
| 37 | + - name: Install phive tools |
| 38 | + run: phive install --trust-gpg-keys 2A8299CE842DD38C |
| 39 | + |
| 40 | + - name: Build phar |
| 41 | + run: make phar |
| 42 | + |
| 43 | + - name: Create Release |
| 44 | + id: create_release |
| 45 | + uses: actions/create-release@v1 |
| 46 | + env: |
| 47 | + GITHUB_TOKEN: ${{ github.token }} |
| 48 | + with: |
| 49 | + tag_name: ${{ github.ref }} |
| 50 | + release_name: Release ${{ github.ref }} |
| 51 | + draft: false |
| 52 | + prerelease: false |
| 53 | + |
| 54 | + - name: Upload Release Asset |
| 55 | + id: upload-release-asset |
| 56 | + uses: actions/upload-release-asset@v1 |
| 57 | + env: |
| 58 | + GITHUB_TOKEN: ${{ github.token }} |
| 59 | + with: |
| 60 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 61 | + asset_path: ./build/prophecy-phpunit.phar |
| 62 | + asset_name: prophecy-phpunit.phar |
| 63 | + asset_content_type: application/zip |
0 commit comments