Skip to content

'update'

'update' #166

name: build-php-cli-windows-vs2022
on:
push:
pull_request:
env:
BUILD_PHP_VERSION: 8.2.13
jobs:
windows-native:
if: 1
runs-on: windows-2022
strategy:
matrix:
php-version:
# - "8.2.13"
# - "8.1.27"
- "8.3.11"
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
vsversion:
- name: show environment info
run: |
git config --global core.autocrlf false
git config --global core.eol lf
git config --global core.ignorecase false
env
ipconfig
uname -a
pwd
ipconfig /all
# 显示逻辑cpu 个数
wmic cpu get NumberOfLogicalProcessors /value
# echo %NUMBER_OF_PROCESSORS%
Write-Output $env:NUMBER_OF_PROCESSORS
systeminfo
echo "BUILD_PHP_VERSION=${{ matrix.php-version }}" >> $Env:GITHUB_ENV
- name: prepare deps soft
shell: cmd
run: |
sapi\quickstart\windows\native-build\windows-init.bat
- name: Set Github ENV variables
run: |
$CURRENT_DIR = Get-Location
echo "PHP_SDK_ARCH=x64" >> $Env:GITHUB_ENV
echo "PHP_SDK_BIN_PATH=${CURRENT_DIR}\var\windows-build-deps\php-sdk-binary-tools\bin" >> $Env:GITHUB_ENV
echo "PHP_SDK_MSYS2_PATH=${CURRENT_DIR}\var\windows-build-deps\php-sdk-binary-tools\msys2\usr\bin" >> $Env:GITHUB_ENV
echo "PHP_SDK_OS_ARCH=x64" >> $Env:GITHUB_ENV
echo "PHP_SDK_PHP_CMD=${CURRENT_DIR}\var\windows-build-deps\php-sdk-binary-tools\bin\php\do_php.bat" >> $Env:GITHUB_ENV
echo "PHP_SDK_ROOT_PATH=${CURRENT_DIR}\var\windows-build-deps\php-sdk-binary-tools" >> $Env:GITHUB_ENV
echo "PHP_SDK_VC_DIR=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC" >> $Env:GITHUB_ENV
echo "PHP_SDK_VC_TOOLSET_VER=$env:VCToolsVersion" >> $Env:GITHUB_ENV
echo "PHP_SDK_VS=vs17" >> $Env:GITHUB_ENV
echo "PHP_SDK_VS_NUM=17" >> $Env:GITHUB_ENV
echo "PHP_SDK_VS_SHELL_CMD=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat amd64" >> $Env:GITHUB_ENV
$X_PATH = "${CURRENT_DIR}\var\windows-build-deps\php-sdk-binary-tools\bin;${CURRENT_DIR}\var\windows-build-deps\php-sdk-binary-tools\msys2\usr\bin;${CURRENT_DIR}\bin\runtime\nasm\;$env:PATH"
echo $X_PATH
echo "PATH=$X_PATH" >> $Env:GITHUB_ENV
- name: show deps soft
if: 1
run: |
$CURRENT_DIR = Get-Location
where perl
php -v
perl -v
nasm -v
where bison.exe
where re2c.exe
- name: php prepare
shell: cmd
run: |
cd var\windows-build-deps\php-src\
.\buildconf.bat -f
- name: php config
shell: cmd
run: |
cd var\windows-build-deps\php-src\
configure.bat ^
--disable-all --disable-cgi --enable-cli ^
--enable-sockets --enable-ctype --enable-pdo --enable-phar ^
--enable-filter ^
--enable-xmlreader --enable-xmlwriter ^
--enable-tokenizer
- name: php build
shell: cmd
run: |
cd var\windows-build-deps\php-src\
nmake /E
- name: Show Build Result
run: |
cd var\windows-build-deps\php-src\
.\x64\Release_TS\php.exe -v
.\x64\Release_TS\php.exe -m
dumpbin /DEPENDENTS ".\x64\Release_TS\php.exe"
- name: production artifacts
uses: actions/upload-artifact@v4
with:
name: php-cli-v${{ env.BUILD_PHP_VERSION }}-vs16-x64
retention-days: 90
path: "var/windows-build-deps/php-src/x64/Release_TS/php.exe"
- name: gh release
uses: softprops/action-gh-release@v2
if: ${{ 0 && startsWith(github.ref, 'refs/tags/') }}
with:
files: "var/windows-build-deps/php-src/x64/Release_TS/php.exe"