Workflow to build PHAR #3
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
name: Publish PHAR | |
on: | |
push: | |
branches: | |
- build-phar | |
release: | |
types: [created] | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Release tag' | |
required: true | |
jobs: | |
publish: | |
name: Release PHAR | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Extract the tag version | |
id: tag | |
run: | | |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
GITHUB_REF=${{ github.event.inputs.tag }} | |
fi | |
echo "tag=${GITHUB_REF##*v}" >> "$GITHUB_OUTPUT" | |
- name: Checkout the code | |
uses: actions/checkout@v3 | |
# with: | |
# ref: v${{ steps.tag.outputs.tag }} | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.1 | |
tools: humbug/box | |
- name: Install the dependencies | |
run: COMPOSER=composer-dev.json composer install --prefer-dist --no-progress | |
- name: Create the PHAR file. | |
run: box compile --no-parallel | |
- name: Upload the PHAR artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: shift-cli.phar | |
path: builds/shift-cli | |
# - name: Upload the PHAR to release | |
# run: gh release upload v${{ steps.tag.outputs.tag }} builds/pint.phar | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |