forked from amphp/ext-uv
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (82 loc) · 2.99 KB
/
Windows-7.4-release.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
75
76
77
78
79
80
81
82
83
84
# GitHub Action for PHP with extensions
name: Windows PHP 7.4 Release
on:
release:
types: [published, edited]
jobs:
windows:
name: Windows
defaults:
run:
shell: cmd
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
version: ['7.4']
arch: [x64]
threads: [ts, nts]
libuv: [ 1.44.2 ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
id: setup-php
uses: cmb69/[email protected]
with:
version: ${{matrix.version}}
arch: ${{matrix.arch}}
ts: ${{matrix.threads}}
- name: Setup MSBuild.exe
uses: microsoft/[email protected]
with:
msbuild-architecture: x64
- name: Fetch & build libuv ${{matrix.libuv}} library dependency
run: |
curl -L https://github.com/libuv/libuv/archive/refs/tags/v${{matrix.libuv}}.zip --output libuv-${{matrix.libuv}}.zip
unzip -xoq libuv-${{matrix.libuv}}.zip
cd libuv-${{matrix.libuv}}
cmake . -DBUILD_TESTING=OFF
cmake --build . --config Release
mkdir ..\..\deps\include\uv
mkdir ..\..\deps\lib
mkdir ..\..\deps\bin
copy /Y include\uv\* ..\..\deps\include\uv\
copy /Y include\* ..\..\deps\include\
copy /Y Release\uv_a.lib ..\..\deps\lib\
copy /Y Release\uv.lib ..\..\deps\lib\
copy /Y Release\uv.lib ..\..\deps\lib\libuv.lib
copy /Y Release\uv.exp ..\..\deps\lib\
copy /Y Release\uv.dll ..\..\deps\bin\
copy /Y Release\uv.dll ..\..\deps\bin\libuv.dll
cd ..
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{matrix.arch}}
toolset: ${{steps.setup-php.outputs.toolset}}
- name: phpize
run: phpize
- name: configure
run: configure --with-uv=shared --enable-debug-pack --with-prefix=${{steps.setup-php.outputs.prefix}}
- name: make
run: nmake
- name: Create binary archive from release
run: |
if "${{matrix.threads}}" == "ts" (
copy /Y x64\Release_TS\php_uv.dll php_uv.dll
) else if "${{matrix.threads}}" == "nts" (
copy /Y x64\Release\php_uv.dll php_uv.dll
)
copy /Y ..\deps\bin\uv.dll uv.dll
7z a ext_uv-${{ github.event.release.tag_name }}-${{matrix.version}}-${{ matrix.threads }}-${{steps.setup-php.outputs.vs}}-x64.zip uv.dll php_uv.dll -tzip -y
- name: Upload the windows binary artifacts
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ext_uv-${{ github.event.release.tag_name }}-${{matrix.version}}-${{ matrix.threads }}-${{steps.setup-php.outputs.vs}}-x64.zip
asset_name: ext_uv-${{ github.event.release.tag_name }}-${{matrix.version}}-${{ matrix.threads }}-${{steps.setup-php.outputs.vs}}-x64
tag: ${{ github.ref }}
overwrite: true
file_glob: true
body: "Windows binary - uv.dll and php_uv.dll "