diff --git a/.github/workflows/release-phar.yml b/.github/workflows/release-phar.yml new file mode 100644 index 0000000..30408ca --- /dev/null +++ b/.github/workflows/release-phar.yml @@ -0,0 +1,32 @@ +on: + release: + types: + - created + +name: Upload Phar to Release + +jobs: + build: + name: Compile and upload Phar + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Compile phalcon-migrations.phar + run: | + composer install --ignore-platform-reqs + vendor/bin/box compile + + - name: Check existence of compiled .phar + run: test -e phalcon-migrations.phar && exit 0 || exit 10 + + - name: Upload to Release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./phalcon-migrations.phar + asset_name: phalcon-migrations.phar + asset_content_type: application/octet-stream