Build Zuri.phar package with build.php #20
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 Zuri.phar package with build.php | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
build-phar: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository. | |
uses: actions/checkout@v4 | |
- 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@v4 | |
with: | |
name: Zuri.phar | |
path: Zuri.phar | |
- name: Codespace Cleanup | |
run: "rm -rf *" |