Skip to content

Release Phar

Release Phar #28

Workflow file for this run

name: Release Phar
on:
release:
types: [published]
jobs:
build-and-release-phar:
name: Build and attach so.phar to the release
runs-on: ubuntu-latest
env:
PHAR_NAME: so.phar
steps:
- name: Set up PHP
uses: shivammathur/setup-php@v3
with:
# Currently, phars built with 8.1 still work on 7.3+
php-version: '8.1'
tools: composer:v2
coverage: none
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v2
- name: Install optimized composer dependencies
uses: ramsey/composer-install@v2
with:
composer-options: "--classmap-authoritative"
- name: Generate dev-free composer autoloader
run: composer dump-autoload --no-dev --classmap-authoritative
- name: Build phar
run: php so app:build ${{ env.PHAR_NAME }} --build-version=${{ github.ref_name }}
- name: Version check
run: php builds/${{ env.PHAR_NAME }} --version
- name: Upload to release
uses: JasonEtco/[email protected]
with:
args: builds/${{ env.PHAR_NAME }} application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}