Skip to content

Attempt to fix the phar build process #6

Attempt to fix the phar build process

Attempt to fix the phar build process #6

Workflow file for this run

name: 'Build and Release PHAR'
on:
push:
tags:
- '*'
jobs:
build-phar:
name: Build PHAR
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: json, fileinfo
tools: composer
- name: Install dependencies
run: composer install --no-dev --optimize-autoloader
- name: Inject version from tag
run: |
VERSION=$(echo "${{ github.ref_name }}" | sed 's/^\\//')
sed -i "s/public const VERSION = .*/public const VERSION = '$VERSION';/" src/Application.php
- name: Build PHAR
run: composer build-phar
- name: Upload PHAR artifact
uses: actions/upload-artifact@v4
with:
name: phpcca.phar
path: phpcca.phar
release:
name: Create Release
needs: build-phar
runs-on: ubuntu-latest
steps:
- name: Download PHAR artifact
uses: actions/download-artifact@v4
with:
name: phpcca.phar
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
artifacts: phpcca.phar
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
draft: true
generateReleaseNotes: true