diff --git a/.github/workflows/build-php-unix.yml b/.github/workflows/build-php-unix.yml index 9f0dcf8..9189d01 100644 --- a/.github/workflows/build-php-unix.yml +++ b/.github/workflows/build-php-unix.yml @@ -47,7 +47,7 @@ jobs: run: | case "${{ matrix.combination }}" in minimal) - echo "EXTENSIONS=pcntl,posix,mbstring,filter,tokenizer,phar" >> "$GITHUB_OUTPUT" + echo "EXTENSIONS=iconv,pcntl,posix,mbstring,filter,tokenizer,phar" >> "$GITHUB_OUTPUT" ;; common) echo "EXTENSIONS=bcmath,bz2,calendar,ctype,curl,dom,exif,fileinfo,filter,ftp,gd,gmp,iconv,xml,mbstring,mbregex,mysqlnd,openssl,pcntl,pdo,pdo_mysql,pdo_sqlite,phar,posix,redis,session,simplexml,soap,sockets,sqlite3,tokenizer,xmlwriter,xmlreader,zlib,zip" >> "$GITHUB_OUTPUT" @@ -137,7 +137,7 @@ jobs: - name: "Download sources" env: GITHUB_TOKEN: ${{ secrets.S_GITHUB_TOKEN }} - run: ${{ steps.process-env.outputs.CMD }} download --with-php=${{ matrix.php-version }} --for-extensions=${{ steps.process-env.outputs.EXTENSIONS }} --retry=5 --prefer-pre-built + run: ${{ steps.process-env.outputs.CMD }} download --with-php=${{ matrix.php-version }} --for-extensions=${{ steps.process-env.outputs.EXTENSIONS }} --retry=5 --prefer-pre-built --ignore-cache-sources=php-src - name: "Build library: ${{ matrix.library }}" run: | diff --git a/.github/workflows/build-php-windows.yml b/.github/workflows/build-php-windows.yml index c196eb3..09e6b3d 100644 --- a/.github/workflows/build-php-windows.yml +++ b/.github/workflows/build-php-windows.yml @@ -29,7 +29,7 @@ jobs: run: | switch ("${{ matrix.combination }}") { "spc-min" { - Add-Content -Path $env:GITHUB_OUTPUT -Value "EXTENSIONS=ctype,fileinfo,mbstring,tokenizer,phar" + Add-Content -Path $env:GITHUB_OUTPUT -Value "EXTENSIONS=ctype,fileinfo,filter,iconv,mbstring,tokenizer,phar" Add-Content -Path $env:GITHUB_OUTPUT -Value "DEPLOY_TARGET=${{ secrets.DEPLOY_SERVER_TARGET_WINDOWS_SPC_MIN }}" } "spc-max" { @@ -90,15 +90,23 @@ jobs: - name: "Download sources" env: GITHUB_TOKEN: ${{ secrets.S_GITHUB_TOKEN }} - run: ${{ steps.process-env.outputs.CMD }} download --with-php=${{ matrix.php-version }} --for-extensions="${{ steps.process-env.outputs.EXTENSIONS }}" --retry=5 --prefer-pre-built + run: ${{ steps.process-env.outputs.CMD }} download --with-php=${{ matrix.php-version }} --for-extensions="${{ steps.process-env.outputs.EXTENSIONS }}" --retry=5 --prefer-pre-built --ignore-cache-sources=php-src + + - name: "Doctor" + env: + GITHUB_TOKEN: ${{ secrets.S_GITHUB_TOKEN }} + run: ${{ steps.process-env.outputs.CMD }} doctor --auto-fix + + - name: "Install UPX" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: ${{ steps.process-env.outputs.CMD }} install-pkg upx - name: "Build extensions: ${{ steps.process-env.outputs.EXTENSIONS }}" - run: | - ${{ steps.process-env.outputs.CMD }} doctor --auto-fix - ${{ steps.process-env.outputs.CMD }} install-pkg upx - - ${{ steps.process-env.outputs.CMD }} build --build-cli --build-micro "${{ steps.process-env.outputs.EXTENSIONS }}" --debug --with-upx-pack + run: ${{ steps.process-env.outputs.CMD }} build --build-cli --build-micro "${{ steps.process-env.outputs.EXTENSIONS }}" --debug --with-upx-pack + - name: "Pack PHP" + run: | $PHPVER = ${{ steps.process-env.outputs.CMD }} dev:php-ver New-Item -ItemType Directory -Force -Path dist Compress-Archive -Path "buildroot\bin\php.exe" -DestinationPath "dist\php-$PHPVER-cli-win.zip" diff --git a/.github/workflows/download-cache.yml b/.github/workflows/download-cache.yml index 726617b..95e1bc5 100644 --- a/.github/workflows/download-cache.yml +++ b/.github/workflows/download-cache.yml @@ -15,6 +15,7 @@ jobs: runs-on: ubuntu-latest outputs: sources: ${{ steps.step1.outputs.sources }} + pkgs: ${{ steps.step1.outputs.pkgs }} steps: - name: "Checkout" uses: "actions/checkout@v4" @@ -24,12 +25,88 @@ jobs: - name: "Create Matrix Variable" id: step1 run: | - VALUE=$(cat config/source.json | jq -M -c keys) - echo 'sources='"$VALUE" >> "$GITHUB_OUTPUT" + SOURCE_VALUE=$(cat config/source.json | jq -M -c keys) + PKG_VALUE=$(cat config/pkg.json | jq -M -c keys) + echo 'sources='"$SOURCE_VALUE" >> "$GITHUB_OUTPUT" + echo 'pkgs='"$PKG_VALUE" >> "$GITHUB_OUTPUT" # parse + download-pkg: + name: "Download package ${{ matrix.pkg }}" + runs-on: ubuntu-latest + needs: define-matrix + timeout-minutes: 60 + strategy: + matrix: + pkg: ${{ fromJSON(needs.define-matrix.outputs.pkgs) }} + fail-fast: false + steps: + - name: "Checkout" + uses: "actions/checkout@v4" + with: + repository: crazywhalecc/static-php-cli + - name: "Setup static-php environment" + run: | + bin/setup-runtime + bin/php bin/composer install --no-dev --no-ansi -q --no-interaction + - name: "Download package ${{ matrix.pkg }}" + run: bin/php bin/spc install-pkg ${{ matrix.pkg }} --debug --no-alt --shallow-clone --skip-extract + - name: "Parse lock file and re-package with file" + run: | + rename_file() { + local src_file="$1" + local target="$2" + local destination_dir="$3" + + if [[ ! -f "$src_file" ]]; then + echo "Error: '$src_file' is not a valid file" >&2 + return 1 + fi + + if [[ "$src_file" =~ \.tar\.(gz|xz)$ ]]; then + local ext=".tar.${BASH_REMATCH[1]}" + local base_name="${src_file%$ext}" + if [[ -z "$base_name" ]]; then + echo "Error: Invalid filename '$src_file'" >&2 + return 1 + fi + + elif [[ "$src_file" =~ \.[^./]+$ ]]; then + local ext=".${src_file##*.}" + local base_name="${src_file%.$ext}" + else + echo "Skip: '$src_file' has no extension" >&2 + return 0 + fi + + local new_name="${target}${ext}" + cp -- "$src_file" "$new_name" + mv "$new_name" "$destination_dir"/ + echo "Renamed: $src_file -> $destination_dir/$new_name" + } + mkdir downloads-mirror-${{ matrix.pkg }} + SOURCE_TYPE=$(cat downloads/.lock.json | jq -M -c -r '."${{ matrix.pkg }}".source_type') + if [ "$SOURCE_TYPE" = "archive" ]; then + cd downloads + rename_file $(cat .lock.json | jq -M -c -r '."${{ matrix.pkg }}".filename') ${{ matrix.pkg }}-spc-mirror ../downloads-mirror-${{ matrix.pkg }} + cd .. + else + cd downloads + tar --exclude-vcs -czvf ${{ matrix.pkg }}-spc-mirror.tgz $(cat .lock.json | jq -M -c -r '."${{ matrix.pkg }}".dirname') + mv ${{ matrix.pkg }}-spc-mirror.tgz ../downloads-mirror-${{ matrix.pkg }}/ + cd .. + fi + - name: "Deploy to OSS" + uses: shallwefootball/s3-upload-action@master + with: + aws_key_id: ${{ secrets.AWS_KEY_ID }} + aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws_bucket: ${{ secrets.AWS_BUCKET }} + source_dir: downloads-mirror-${{ matrix.pkg }}/ + destination_dir: static-php-cli/deps/spc-download-mirror/${{ matrix.pkg }}/ + endpoint: ${{ secrets.AWS_ENDPOINT }} download-source: - name: "Download ${{ matrix.source }}" + name: "Download source ${{ matrix.source }}" runs-on: ubuntu-latest needs: define-matrix timeout-minutes: 60 diff --git a/.github/workflows/ext-matrix-tests-win-php84.yml b/.github/workflows/ext-matrix-tests-win-php84.yml new file mode 100644 index 0000000..db8d8bd --- /dev/null +++ b/.github/workflows/ext-matrix-tests-win-php84.yml @@ -0,0 +1,120 @@ +name: "Extension matrix tests PHP 8.4 (Windows)" + +on: + workflow_dispatch: + schedule: + - cron: "0 1 * * 5" + +jobs: + test: + name: "${{ matrix.extension }} (PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }})" + runs-on: ${{ matrix.operating-system }} + strategy: + fail-fast: false + matrix: + extension: + - amqp + - apcu + - bcmath + - bz2 + - calendar + - ctype + - curl + - dba + - dom + - ds + - exif + - ffi + - fileinfo + - filter + - ftp + - gd + - iconv + - igbinary + - libxml + - mbregex + - mbstring + - mysqli + - mysqlnd + - opcache + - openssl + - pdo + - pdo_mysql + - pdo_sqlite + - pdo_sqlsrv + - phar + - rar + - redis + - session + - shmop + - simdjson + - simplexml + - soap + - sockets + - sqlite3 + - sqlsrv + - ssh2 + - sysvshm + - tokenizer + - xml + - xmlreader + - xmlwriter + - yac + - yaml + - zip + - zlib + php-version: + - "8.4" + operating-system: + - "windows-latest" + + steps: + - name: "Checkout" + uses: "actions/checkout@v4" + + - name: "Checkout remote" + if: github.repository != 'crazywhalecc/static-php-cli' + uses: actions/checkout@v4 + with: + repository: crazywhalecc/static-php-cli + ref: main + + - name: "Setup PHP" + uses: shivammathur/setup-php@v2 + with: + php-version: 8.4 + tools: pecl, composer + extensions: curl, openssl, mbstring, filter + ini-values: memory_limit=-1 + + - name: "Cache composer packages" + id: composer-cache + uses: actions/cache@v4 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php + + - id: cache-download + uses: actions/cache@v4 + with: + path: downloads + key: php-${{ matrix.php-version }}-dependencies-for-tests-windows + + - name: "Install Dependencies" + run: composer update -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-dev + + - name: "Validate SPC powershell script" + run: bin/spc --version + + # If there's no dependencies cache, fetch sources + - name: "Download sources" + env: + GITHUB_TOKEN: ${{ secrets.S_GITHUB_TOKEN }} + run: bin/spc download --with-php=${{ matrix.php-version }} --for-extensions=${{ matrix.extension }} + + - name: "Build library: ${{ matrix.extension }}" + run: | + bin/spc doctor --auto-fix + bin/spc build --build-cli --build-micro ${{ matrix.extension }} --debug --with-suggested-libs --with-suggested-exts diff --git a/.github/workflows/pack-libs.yml b/.github/workflows/pack-libs.yml index aeca84c..3eb5145 100644 --- a/.github/workflows/pack-libs.yml +++ b/.github/workflows/pack-libs.yml @@ -36,7 +36,6 @@ jobs: - windows-2022 - macos-14 lib: - - attr - gmssl - jbig - lerc @@ -54,7 +53,6 @@ jobs: - libiconv - libavif - libpng - - libtiff - icu - libcares - libevent @@ -77,7 +75,6 @@ jobs: - { runner: "windows-2022", lib: "brotli" } - { runner: "windows-2022", lib: "libargon2" } - { runner: "windows-2022", lib: "libiconv" } - - { runner: "windows-2022", lib: "libtiff" } - { runner: "windows-2022", lib: "icu" } - { runner: "windows-2022", lib: "libcares" } - { runner: "windows-2022", lib: "libevent" } @@ -89,7 +86,6 @@ jobs: - { runner: "windows-2022", lib: "libaom" } - { runner: "windows-2022", lib: "libde265" } - { runner: "windows-2022", lib: "libheif" } - - { runner: "windows-2022", lib: "attr" } - { runner: "windows-2022", lib: "jbig" } - { runner: "windows-2022", lib: "lerc" } - { runner: "windows-2022", lib: "libacl" } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy