Skip to content

Build 'all' PHP version: 8.4 #30

Build 'all' PHP version: 8.4

Build 'all' PHP version: 8.4 #30

name: "AFT - Build PHP versions"
on:
workflow_dispatch:
inputs:
selectos:
required: true
description: Build target OS
default: 'linux-x86_64'
type: choice
options:
- 'all'
# - 'linux-x86_64'
# - 'linux-aarch64'
- 'linux-x86_64-glibc'
# - 'linux-aarch64-glibc'
# - 'macos-x86_64'
- 'macos-aarch64'
- 'windows'
php-version:
required: true
description: PHP version to compile
default: '8.4'
type: choice
options:
- '8.4'
- '8.3'
# - '8.2'
# - '8.1'
debug:
description: Show full build logs
type: boolean
run-name: "Build '${{ inputs.selectos }}' PHP version: ${{ inputs.php-version }}"
jobs:
# Run single UNIX build
unix-static-build:
if: ${{ inputs.selectos != 'windows' && inputs.selectos != 'all' }}
uses: appsfortableau/static-php-cli/.github/workflows/build-unix.yml@main
with:
os: ${{ inputs.selectos }}
php-version: ${{ inputs.php-version }}
debug: ${{ inputs.debug }}
build-micro: true
extensions: 'odbc,pdo_odbc,bcmath,calendar,ctype,curl,dba,dom,exif,fileinfo,filter,gd,libxml,mbregex,mbstring,msgpack,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pdo_sqlsrv,pgsql,phar,posix,readline,redis,session,simplexml,sockets,sodium,sqlite3,sqlsrv,tokenizer,xml,xmlreader,xmlwriter,zip,zlib'
# Run UNIX build for all given versions.
unix-all-static-builds:
if: ${{ inputs.selectos == 'all' }}
uses: appsfortableau/static-php-cli/.github/workflows/build-unix.yml@main
strategy:
matrix:
selectos: [linux-x86_64-glibc, macos-aarch64]
with:
os: ${{ matrix.selectos }}
php-version: ${{ inputs.php-version }}
debug: ${{ inputs.debug }}
extensions: 'odbc,pdo_odbc,bcmath,calendar,ctype,curl,dba,dom,exif,fileinfo,filter,gd,libxml,mbregex,mbstring,msgpack,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pdo_sqlsrv,pgsql,phar,posix,readline,redis,session,simplexml,sockets,sodium,sqlite3,sqlsrv,tokenizer,xml,xmlreader,xmlwriter,zip,zlib'
# Run single UNIX build
# windows-static-build:
# if: ${{ inputs.selectos == 'windows' || inputs.selectos == 'all' }}
# uses: appsfortableau/static-php-cli/.github/workflows/build-windows-x86_64.yml@aft-main
# with:
# version: ${{ inputs.php-version }}
# extensions: 'odbc,pdo_odbc,bcmath,calendar,ctype,curl,dba,exif,fileinfo,filter,gd,libxml,mbregex,mbstring,msgpack,mysqli,mysqlnd,opcache,openssl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pdo_sqlsrv,pgsql,phar,redis,session,simplexml,sockets,sodium,sqlite3,sqlsrv,tokenizer,xml,xmlreader,xmlwriter,zip,zlib'
release-php-version:
if: ${{ inputs.selectos == 'all' }}
#needs: [unix-all-static-builds, windows-static-build]
needs: [unix-all-static-builds]
name: Release PHP version ${{ inputs.php-version }}
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
pattern: php-cli-*
- id: get_php_version
run: |
ls -la **/*
chmod +x ./php-cli-${{ inputs.php-version }}-linux-x86_64-glibc/php
echo "PHP_VERSION=$(./php-cli-${{ inputs.php-version }}-linux-x86_64-glibc/php -r "echo PHP_VERSION;")" >> "$GITHUB_OUTPUT"
- name: Recursively zip all files in each folder, naming zip after folder
run: |
find . -type d | while read dir; do
[ "$dir" = "." ] && continue
foldername=$(basename "$dir")
(cd "$dir" && zip -r "../${foldername}.zip" .)
done
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.get_php_version.outputs.PHP_VERSION }}
files: php-cli-*.zip
make_latest: true