Skip to content
name: build-php-cli-windows-cygwin
on:
push:
pull_request:
env:
BUILD_PHP_VERSION: 8.2.13
jobs:
windows-cygwin:
if: 0
runs-on: windows-latest
strategy:
matrix:
php-version:
- "8.2.13"
# - "8.1.27"
# - "8.3.1"
steps:
- name: Prepare git
run: |
git config --global core.autocrlf false
git config --global core.eol lf
env
ipconfig
uname -a
pwd
# ipconfig /all
- uses: actions/checkout@v3
- name: set php version
shell: bash # # https://docs.github.com/zh/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
run: |
echo "BUILD_PHP_VERSION=${{ matrix.php-version }}" >> $GITHUB_ENV
# https://docs.github.com/zh/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable
- name: Prepare submodule
run: |
ipconfig /all
# git submodule update --init
- name: Cache cygwin packages
id: cache-cygwin
uses: actions/cache@v3
env:
cache-name: cache-cygwin-packages
with:
path: C:/cygwin-packages
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install deps
uses: cygwin/cygwin-install-action@v4
with:
platform: x86_64
packages: make wget tar libtool re2c bison gcc-g++ autoconf automake openssl libpcre2-devel libssl-devel libcurl-devel libxml2-devel libxslt-devel libgmp-devel ImageMagick libpng-devel libjpeg-devel libfreetype-devel libwebp-devel libsqlite3-devel zlib-devel libbz2-devel liblz4-devel liblzma-devel libzip-devel libicu-devel libonig-devel libcares-devel libsodium-devel libyaml-devel libMagick-devel libzstd-devel libbrotli-devel libreadline-devel libintl-devel libpq-devel libssh2-devel libidn2-devel gettext-devel coreutils openssl-devel zip unzip libpq5 libpq-devel git curl
- name: Install re2c
run: |
bash ./sapi/scripts/cygwin/install-re2c.sh
- name: Prepare
run: |
# git config --global --add safe.directory /cygdrive/d/a/swoole-cli/swoole-cli
# git submodule update --init
bash ./sapi/scripts/cygwin/cygwin-config-ext.sh --php-version ${{ env.BUILD_PHP_VERSION }}
- name: Configure
run: |
bash ./sapi/scripts/cygwin/cygwin-config.sh
- name: Build
run: |
bash ./sapi/scripts/cygwin/cygwin-build.sh
- name: Show Build Result
run: |
./bin/php-cli.exe -v
./bin/php-cli.exe -m
./bin/php-cli.exe --ri pdo_pgsql
./bin/php-cli.exe --ri swoole
- name: Archive
run: |
bash ./sapi/scripts/cygwin/cygwin-archive.sh
- name: production artifacts
uses: actions/upload-artifact@v3
with:
name: php-cli-v${{ env.BUILD_PHP_VERSION }}-cygwin-x64
path: php-cli-v${{ env.BUILD_PHP_VERSION }}-cygwin-x64.zip
- name: gh release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: php-cli-v${{ env.BUILD_PHP_VERSION }}-cygwin-x64.zip