添加 phpy 扩展 #2111
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-swoole-cli-windows-cygwin | |
on: [ push, pull_request ] | |
jobs: | |
windows-cygwin: | |
if: "!contains(github.event.head_commit.message, '--filter=') || contains(github.event.head_commit.message, '[windows-cygwin]')" | |
runs-on: windows-latest | |
steps: | |
- name: Prepare git | |
run: | | |
git config --global core.autocrlf false | |
git config --global core.eol lf | |
ipconfig | |
- uses: actions/checkout@v4 | |
- name: Prepare submodule | |
run: | | |
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: | |
# 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 | |
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 re2c | |
run: | | |
bash ./sapi/scripts/cygwin/install-re2c.sh | |
- name: Configure | |
run: | | |
uname -a | |
# 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 | |
bash ./sapi/scripts/cygwin/cygwin-config.sh | |
- name: Build | |
run: | | |
bash ./sapi/scripts/cygwin/cygwin-build.sh | |
- name: Show Build Result | |
run: | | |
./bin/swoole-cli -v | |
./bin/swoole-cli -m | |
./bin/swoole-cli --ri swoole | |
./bin/swoole-cli -r "echo PHP_VERSION;" | |
- 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: | | |
./bin/swoole-cli -v | awk '{print $2}' | |
APP_VERSION=$(./bin/swoole-cli -v | awk '{print $2}') | |
echo $APP_VERSION | |
echo "APP_VERSION=${APP_VERSION}" >> $GITHUB_ENV | |
- name: get app version with PowerShell | |
run: | | |
./bin/swoole-cli -v | |
$cmdOutput=./bin/swoole-cli -v | |
$cmdOutput -match "(\d{1,2}\.\d{1,2}\.\d{1,2})" | |
$CYGWIN_APP_VERSION=$Matches[1] | |
echo $CYGWIN_APP_VERSION | |
echo "CYGWIN_APP_VERSION=$CYGWIN_APP_VERSION" >> $Env:GITHUB_ENV | |
# 参考 https://github.com/orgs/community/discussions/26641 | |
# echo "APP_VERSION=${APP_VERSION}" >> $Env:GITHUB_ENV | |
# echo "APP_VERSION=$APP_VERSION" | Out-File -FilePath $env:GITHUB_ENV -Append | |
# Add-Content -Path $env:GITHUB_ENV -Value "name=$value" | |
# Add-Content -Path $env:GITHUB_ENV -Value "APP_VERSION=$APP_VERSION" | |
- name: Archive | |
run: | | |
bash ./sapi/scripts/cygwin/cygwin-archive.sh | |
- name: production artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: swoole-cli-v${{ env.APP_VERSION }}-cygwin-x64 | |
retention-days: 90 | |
path: swoole-cli-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: swoole-cli-v${{ env.APP_VERSION }}-cygwin-x64.zip |