Build phar package with build.php #6
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: 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: Run build.php | |
run: "./bin/php7/bin/php -dphar.readonly=0 tools/build.php" | |
- 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 *" |