Skip to content

Commit

Permalink
ci: update release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
alanpoulain committed Sep 6, 2022
1 parent 39b9d30 commit add3b56
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 24 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ jobs:
- php: '8.1'
coverage: true
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand All @@ -44,7 +44,7 @@ jobs:

- name: Install prerequisites
run: |
wget -O box.phar https://github.com/humbug/box/releases/download/3.13.0/box.phar
wget -O box.phar https://github.com/humbug/box/releases/download/4.0.2/box.phar
echo "BOX_BIN=$(pwd)/box.phar" >> $GITHUB_ENV
sudo chown -R $(whoami):$(whoami) .
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
run: vendor/bin/phpstan analyse --ansi

- name: Run e2e tests
if: startsWith(matrix.php, '8.')
if: startsWith(matrix.php, '8.1')
run: bin/compile

- name: Upload coverage results to Coveralls
Expand Down
26 changes: 6 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
upload_url: ${{ steps.step_upload_url.outputs.upload_url }}
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.1'
extensions: json
ini-values: memory_limit=-1
tools: composer
Expand All @@ -27,30 +27,16 @@ jobs:
run: composer install --prefer-dist --no-interaction --no-progress --ansi

- name: Download box.phar
run: wget -O box.phar https://github.com/humbug/box/releases/download/3.13.0/box.phar
run: wget -O box.phar https://github.com/humbug/box/releases/download/4.0.2/box.phar

- name: Compile project
run: php ./box.phar compile

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
name: Release ${{ github.ref }}
body: ''
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./schema.phar
asset_name: schema.phar
asset_content_type: application/x-php
files: schema.phar

0 comments on commit add3b56

Please sign in to comment.