Skip to content

update

update #8710

name: build-windows-cygwin
on:
push:
pull_request:
env:
BUILD_PHP_VERSION: 8.2.27
jobs:
windows-cygwin:
if: 1
runs-on: windows-latest
steps:
- name: Show Environment Info
shell: cmd
run: |
ver
wmic cpu get name, caption, maxclockspeed, status
systeminfo
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
systeminfo | findstr /B /C:"Manufacturer" /C:"Product" /C:"Version"
set
ipconfig
uname -a
pwd
ipconfig /all
- name: Prepare git
run: |
git config --global core.autocrlf false
git config --global core.eol lf
git config --global core.ignorecase false
- uses: actions/checkout@v4
- name: Prepare submodule
run: |
ipconfig /all
# git submodule update --init
- name: Cache cygwin packages
id: cache-cygwin
uses: actions/cache@v4
env:
cache-name: cache-cygwin-packages
with:
path: C:\cygwin-packages
key: "${{ runner.os }}-build-${{ env.cache-name }}"
- name: Cache pool
id: cache-cygwin-pool
uses: actions/cache@v4
with:
path: "${{ github.workspace }}\\pool\\"
key: "${{ runner.os }}-build-pool-cache"
- name: Install Cygwin
uses: cygwin/cygwin-install-action@v2
with:
site: https://mirrors.kernel.org/sourceware/cygwin/
# with:
# platform: x64
# 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
- name: Install Cygwin Packages with bash
if: 0
shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0}
run: |
ls -lah /cygdrive/c/
ls -lah /cygdrive/d/
cp -f /cygdrive/c/setup.exe /cygdrive/c/cygwin/bin/setup-x86_64.exe
bash ./sapi/scripts/cygwin/install-cygwin.sh
- name: Install Cygwin Packages
if: 1
run: |
Copy-Item -Path "C:\setup.exe" -Destination "${{ github.workspace }}\setup-x86_64.exe"
cmd /c .\sapi\quickstart\windows\cygwin-build\install-cygwin.bat
- name: Install re2c
shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0}
run: |
bash ./sapi/scripts/cygwin/install-re2c.sh
- name: Configure
shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0}
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
shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0}
run: |
bash ./sapi/scripts/cygwin/cygwin-config.sh --php-version ${{ env.BUILD_PHP_VERSION }}
- name: Build
shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0}
run: |
bash ./sapi/scripts/cygwin/cygwin-build.sh
- name: get app version with bash
# 参考 https://github.com/marketplace/actions/install-cygwin
shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0}
# shell: C:\cygwin\bin\bash.EXE --login --noprofile --norc -e -o pipefail -o igncr {0}
run: |
./socat/socat -V | grep 'socat version' | awk '{ print $3 }'
APP_VERSION=$(./socat/socat -V | grep 'socat version' | awk '{ print $3 }')
echo $APP_VERSION
echo "APP_VERSION=${APP_VERSION}" >> $GITHUB_ENV
- name: Archive
run: |
bash ./sapi/scripts/cygwin/cygwin-archive.sh
- name: production artifacts
uses: actions/upload-artifact@v4
with:
name: socat-v${{ env.APP_VERSION }}-cygwin-x64
retention-days: 90
path: socat-v${{ env.APP_VERSION }}-cygwin-x64.zip
- name: gh release
uses: softprops/action-gh-release@v2
if: ${{ startsWith(github.ref, 'refs/tags/') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: socat-v${{ env.APP_VERSION }}-cygwin-x64.zip