diff --git a/.github/workflows/aft-build-all.yaml b/.github/workflows/aft-build-all.yaml new file mode 100644 index 000000000..cf8ed4af5 --- /dev/null +++ b/.github/workflows/aft-build-all.yaml @@ -0,0 +1,95 @@ +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 diff --git a/.github/workflows/build-windows-x86_64.yml b/.github/workflows/build-windows-x86_64.yml index 57a681848..e94fb2693 100644 --- a/.github/workflows/build-windows-x86_64.yml +++ b/.github/workflows/build-windows-x86_64.yml @@ -32,6 +32,31 @@ on: debug: description: enable debug logs type: boolean + workflow_call: + inputs: + version: + required: true + description: php version to compile + default: '8.4' + type: string + build-cli: + description: build cli binary + default: true + type: boolean + build-micro: + description: build phpmicro binary + type: boolean + extensions: + description: extensions to compile (comma separated) + required: true + type: string + prefer-pre-built: + description: prefer pre-built binaries (reduce build time) + type: boolean + default: true + debug: + description: enable debug logs + type: boolean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/yarn.lock b/yarn.lock index 61bba08eb..e3b8534be 100644 --- a/yarn.lock +++ b/yarn.lock @@ -704,9 +704,9 @@ mark.js@8.11.1: integrity sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ== mdast-util-to-hast@^13.0.0: - version "13.2.0" - resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz#5ca58e5b921cc0a3ded1bc02eed79a4fe4fe41f4" - integrity sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA== + version "13.2.1" + resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-13.2.1.tgz#d7ff84ca499a57e2c060ae67548ad950e689a053" + integrity sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA== dependencies: "@types/hast" "^3.0.0" "@types/mdast" "^4.0.0"