-
Notifications
You must be signed in to change notification settings - Fork 12
74 lines (74 loc) · 2.52 KB
/
build-windows-php.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: build-windows-php
on:
push:
branches:
- "**"
tags:
- "*"
jobs:
build-windows-php:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
php-version: ["8.3.6"]
arch: [x86_64]
include:
- arch: x86_64
arch-short: x64
name: PHP ${{ matrix.php-version }} build on ${{ matrix.os }} for arch ${{ matrix.arch }}
env:
TOOLS_DIR: "C:\\tools"
PHP_DEVEL_HOME: "C:\\tools\\php-${{ matrix.php-version }}-devel-vs16-${{ matrix.arch-short }}"
PHP_DEVEL_URL: "https://windows.php.net/downloads/releases/php-devel-pack-${{ matrix.php-version }}-Win32-vs16-${{ matrix.arch-short }}.zip"
steps:
- name: Configure toolchain
run: |
cmake --version
python3 --version
pip3 install protobuf grpcio-tools
- name: Install MSVC Dev Cmd
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Install PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Check PHP Version
run: php -v
- name: Download PHP development pack
run: |
$php_devel_url = "${{ env.PHP_DEVEL_URL }}"
$php_devel_zip = "php-devel.zip"
Invoke-WebRequest -Uri $php_devel_url -OutFile $php_devel_zip
Expand-Archive -Path $php_devel_zip -DestinationPath "${{ env.TOOLS_DIR }}"
Remove-Item -Path $php_devel_zip
ls "${{ env.TOOLS_DIR }}"
ls "${{ env.PHP_DEVEL_HOME }}"
- name: Checkout project
uses: actions/checkout@v4
- name: Configure project
run: >
cmake -G"NMake Makefiles"
-DPHP_DEVEL_HOME=${{ env.PHP_DEVEL_HOME }}
-DVIRGIL_LIB_PYTHIA=OFF
-DCMAKE_BUILD_TYPE=Release
-DVIRGIL_PACKAGE_PLATFORM_ARCH=${{ matrix.arch }}
-DVIRGIL_PACKAGE_LANGUAGE_VERSION=${{ matrix.php-version }}
-DCPACK_OUTPUT_FILE_PREFIX=php
-DENABLE_CLANGFORMAT=OFF
-Bbuild -S.
- name: Build project
run: cmake --build build --parallel %NUMBER_OF_PROCESSORS%
- name: Test project
working-directory: build
run: ctest --verbose
- name: Package project
working-directory: build
run: cpack
- name: Attach artifacts to the release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: build/php/*.tar.gz