Skip to content

Publish the released PHAR #32

Publish the released PHAR

Publish the released PHAR #32

Workflow file for this run

name: Publish the released PHAR
on:
release:
types: [ created ]
workflow_dispatch:
inputs:
tag:
description: 'Tag release version'
required: true
jobs:
publish:
runs-on: ubuntu-latest
name: Release PHAR
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:
submodules: true
ref: v${{ steps.tag.outputs.tag }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, json, dom, curl, libxml, fileinfo, tokenizer, xml
ini-values: error_reporting=E_ALL
coverage: none
- name: Git setup
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git config --global core.autocrlf false
git config --global core.eol lf
- name: Install the dependencies
run: composer install --prefer-dist --no-progress --no-interaction --no-suggest
- name: Create the PHAR file
id: build
run: |
IS_DIRTY=1
sudo php ./codestyle app:build codestyle.phar --build-version=${{ steps.tag.outputs.tag }}
- name: Upload the PHAR artifact
uses: actions/upload-artifact@v3
with:
name: codestyle.phar
path: builds/codestyle.phar
- name: Upload the PHAR to release
run: gh release upload v${{ steps.tag.outputs.tag }} builds/codestyle.phar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}