Skip to content

Build phar package with build.php #19

Build phar package with build.php

Build phar package with build.php #19

Workflow file for this run

name: Build phar package.
run-name: Build phar package with build.php
on: [push]
jobs:
build-phar:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository.
uses: actions/checkout@v3
- name: Download php-binaries.
run: "curl -sL https://github.com/pmmp/PHP-Binaries/releases/latest/download/PHP-Linux-x86_64-PM5.tar.gz -o php.tar.gz"
- name: Extract php-binaries.
run: "tar -xvzf php.tar.gz"
- name: chmod the php-binaries.
run: "chmod +x ./bin/php7/bin/php"
- name: Fix opcache.so
run: EXTENSION_DIR=$(find "$(pwd)/bin" -name "*debug-zts*") \
grep -q '^extension_dir' bin/php7/bin/php.ini && sed -i'bak' "s{^extension_dir=.*{extension_dir=\"$EXTENSION_DIR\"{" bin/php7/bin/php.ini || echo "extension_dir=\"$EXTENSION_DIR\"" >> bin/php7/bin/php.ini
- name: Install php-cs-fixer.
run: "curl -sL https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/latest/download/php-cs-fixer.phar -o php-cs-fixer.phar"
- name: Run php-cs-fixer.
run: "./bin/php7/bin/php php-cs-fixer.phar fix src"
- name: Install composer.phar
run: "curl -sL https://getcomposer.org/download/latest-stable/composer.phar -o composer.phar"
- name: Install dependencies.
run: "./bin/php7/bin/php -dphar.readonly=0 composer.phar install"
- name: Build the ProfanityFilter.phar using pharynx
run: "./bin/php7/bin/php -dphar.readonly=0 composer.phar run-script --no-dev build"
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: ProfanityFilter Build Phar
path: ProfanityFilter.phar
- name: Upload build information artifact.
uses: actions/upload-artifact@v3
with:
name: Build information
path: build_info.json
- name: Codespace Cleanup
run: "rm -rf *"