Skip to content

Commit e8025ee

Browse files
committed
2 parents ba75240 + f5cbab9 commit e8025ee

File tree

4 files changed

+472
-74
lines changed

4 files changed

+472
-74
lines changed

.github/workflows/main.yml

Lines changed: 127 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,130 @@
1-
name: CI
2-
3-
# Controls when the workflow will run
4-
on:
5-
# Triggers the workflow on push or pull request events but only for the master branch
6-
push:
7-
branches: [ master ]
8-
pull_request:
9-
branches: [ master ]
10-
11-
# Allows you to run this workflow manually from the Actions tab
12-
workflow_dispatch:
13-
14-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1+
name: Build and Test on Windows
2+
on:
3+
schedule:
4+
- cron: '0 2 * * *'
155
jobs:
16-
p80ts:
17-
name: 8.0ts
18-
runs-on: windows-latest
6+
pre:
7+
defaults:
8+
run:
9+
shell: cmd
10+
strategy:
11+
matrix:
12+
arch: [x64]
13+
runs-on: windows-2019
1914
steps:
20-
- name: Setup PHP
21-
uses: shivammathur/setup-php@v2
22-
with:
23-
php-version: '8.0'
24-
extensions: memcached
25-
env:
26-
phpts: ts # specify ts or nts
27-
p80nts:
28-
name: 8.0nts
29-
runs-on: windows-latest
15+
- name: Checkout memcached
16+
uses: actions/checkout@v2
17+
with:
18+
repository: php-memcached-dev/php-memcached
19+
- name: Download memcached.exe
20+
run: |
21+
curl -L http://static.runoob.com/download/memcached-1.4.5-amd64.zip -o memcached.zip
22+
7z x memcached.zip -o.\mem
23+
mem\memcached-amd64\memcached.exe -d
24+
25+
ts74-x64:
26+
needs: [pre]
27+
defaults:
28+
run:
29+
shell: cmd
30+
runs-on: windows-2019
31+
strategy:
32+
matrix:
33+
version: ["7.4","8.0","8.1"]
34+
arch: [x64,x86]
35+
ts: [ts,nts]
3036
steps:
31-
- name: Setup PHP
32-
uses: shivammathur/setup-php@v2
33-
with:
34-
php-version: '8.0'
35-
extensions: memcached
36-
37-
p74ts:
38-
name: 7.4ts
39-
runs-on: windows-latest
40-
steps:
41-
- name: Setup PHP
42-
uses: shivammathur/setup-php@v2
43-
with:
44-
php-version: '7.4'
45-
extensions: memcached
46-
env:
47-
phpts: ts # specify ts or nts
48-
p74nts:
49-
name: 7.4nts
50-
runs-on: windows-latest
51-
steps:
52-
- name: Setup PHP
53-
uses: shivammathur/setup-php@v2
54-
with:
55-
php-version: '7.0'
56-
extensions: memcached
57-
p73ts:
58-
name: 7.3ts
59-
runs-on: windows-latest
60-
steps:
61-
- name: Setup PHP
62-
uses: shivammathur/setup-php@v2
63-
with:
64-
php-version: '7.3'
65-
extensions: memcached
66-
env:
67-
phpts: ts # specify ts or nts
68-
p73nts:
69-
name: 7.3nts
70-
runs-on: windows-latest
71-
steps:
72-
- name: Setup PHP
73-
uses: shivammathur/setup-php@v2
74-
with:
75-
php-version: '7.3'
76-
extensions: memcached
37+
- name: Checkout memcached
38+
uses: actions/checkout@v2
39+
with:
40+
repository: php-memcached-dev/php-memcached
41+
- name: Setup PHP
42+
id: setup-php
43+
uses: cmb69/setup-php-sdk@v0.3
44+
with:
45+
version: ${{matrix.version}}
46+
arch: ${{matrix.arch}}
47+
ts: ${{matrix.ts}}
48+
deps: zlib
49+
- name: Download deps
50+
run: |
51+
curl -L https://github.com/lifenglsf/libmemcached-window-dll-lib/blob/main/${{matrix.arch}}.zip?raw=true -o ${{matrix.arch}}.zip
52+
7z x ${{matrix.arch}}.zip -o..\deps
53+
- name: Enable Developer Command Prompt
54+
uses: ilammy/msvc-dev-cmd@v1
55+
with:
56+
arch: ${{matrix.arch}}
57+
toolset: ${{steps.setup-php.outputs.toolset}}
58+
- name: phpize
59+
run: |
60+
phpize
61+
- name: configure
62+
run: |
63+
configure --enable-memcached=shared --enable-memcached-session --enable-memcached-json --with-php-build=..\deps --with-prefix=${{steps.setup-php.outputs.prefix}} --with-config-file-path=${{steps.setup-php.outputs.prefix}}
64+
- name: make
65+
run: nmake
66+
- name: make install
67+
run: nmake install
68+
- name: copy ini
69+
run: copy ${{steps.setup-php.outputs.prefix}}\php.ini-development ${{steps.setup-php.outputs.prefix}}\php.ini
70+
- name: copy libmemcached
71+
run: copy ..\deps\bin\libmemcached.dll ${{steps.setup-php.outputs.prefix}}
72+
- name: set extension dir
73+
run : echo extension_dir="${{steps.setup-php.outputs.prefix}}\ext"; >>${{steps.setup-php.outputs.prefix}}\php.ini
74+
- name: show file
75+
run: dir ${{steps.setup-php.outputs.prefix}} /N /S
76+
- name: extension path
77+
run: php -i|grep "extension_dir"
78+
- name: add memcached ext
79+
run : echo extension=memcached; >>${{steps.setup-php.outputs.prefix}}\php.ini
80+
- name: show ini config
81+
run: php --ini
82+
- name: php module
83+
run: php -m
84+
- name: copy file
85+
run: |
86+
mkdir -p ${{github.workspace}}\php-${{matrix.version}}-${{matrix.arch}}-${{matrix.ts}}
87+
copy ..\deps\bin\libmemcached.dll ${{ github.workspace }}\php-${{matrix.version}}-${{matrix.arch}}-${{matrix.ts}}
88+
copy ${{steps.setup-php.outputs.prefix}}\ext\php_memcached.dll ${{ github.workspace }}\php-${{matrix.version}}-${{matrix.arch}}-${{matrix.ts}}
89+
dir ${{ github.workspace }} /N /S
90+
7z a ${{ github.workspace }}\php${{matrix.version}}-${{matrix.arch}}-${{matrix.ts}}.7z ${{ github.workspace }}\php-${{matrix.version}}-${{matrix.arch}}-${{matrix.ts}}\*.*
91+
92+
#- name: test
93+
# run: nmake test
94+
- name: Accidentally upload to the same artifact via multiple jobs
95+
uses: actions/upload-artifact@v3
96+
with:
97+
name: php${{matrix.version}}-${{matrix.arch}}-${{matrix.ts}}
98+
path: ${{ github.workspace }}\php${{matrix.version}}-${{matrix.arch}}-${{matrix.ts}}.7z
99+
#- name: create zip
100+
# run: |
101+
# zip -r ${{steps.setup-php.outputs.prefix}}/php-7.4-x64.zip ${{steps.setup-php.outputs.prefix}}/libmemcached.dll ${{steps.setup-php.outputs.prefix}}/ext/php_memcached.dll
102+
create_tag:
103+
needs: [ts74-x64]
104+
defaults:
105+
run:
106+
shell: cmd
107+
runs-on: windows-2019
108+
steps:
109+
- name : download artifact
110+
uses: marcofaggian/action-download-multiple-artifacts@v3.0.7
111+
with:
112+
names: php7.4-x64-ts php8.0-x64-ts php8.1-x64-ts php7.4-x64-nts php8.0-x64-nts php8.1-x64-nts php7.4-x86-nts php8.0-x86-nts php8.1-x86-nts php7.4-x86-ts php8.0-x86-ts php8.1-x86-ts
113+
paths: ${{ github.workspace }} ${{ github.workspace }} ${{ github.workspace }} ${{ github.workspace }} ${{ github.workspace }} ${{ github.workspace }} ${{ github.workspace }} ${{ github.workspace }} ${{ github.workspace }} ${{ github.workspace }} ${{ github.workspace }} ${{ github.workspace }}
114+
- name: show file
115+
run: |
116+
dir ${{ github.workspace }} /N /S
117+
- name: delete_tag
118+
uses: dev-drprasad/delete-tag-and-release@v0.2.0
119+
with:
120+
delete_release: true # default: false
121+
tag_name: sample # tag name to delete
122+
env:
123+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124+
- name: create release
125+
uses: ncipollo/release-action@v1
126+
with:
127+
artifacts: "${{github.workspace}}\\php7.4-x64-ts.7z,${{github.workspace}}\\php8.0-x64-ts.7z,${{github.workspace}}\\php8.1-x64-ts.7z,${{github.workspace}}\\php7.4-x64-nts.7z,${{github.workspace}}\\php8.0-x64-nts.7z,${{github.workspace}}\\php8.1-x64-nts.7z,${{github.workspace}}\\php7.4-x86-ts.7z,${{github.workspace}}\\php8.0-x86-ts.7z,${{github.workspace}}\\php8.1-x86-ts.7z,${{github.workspace}}\\php7.4-x86-nts.7z,${{github.workspace}}\\php8.0-x86-nts.7z,${{github.workspace}}\\php8.1-x86-nts.7z"
128+
token: ${{ secrets.GITHUB_TOKEN }}
129+
prerelease: true
130+
tag: sample
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
name: Build and Test on Windows
2+
on:
3+
push:
4+
5+
env:
6+
Ver: windows_msgpack_support
7+
Mg: 2.2.0RC1
8+
Ig: 3.2.7
9+
jobs:
10+
ts74-x64-msgpack:
11+
defaults:
12+
run:
13+
shell: cmd
14+
runs-on: windows-2019
15+
strategy:
16+
matrix:
17+
version: ["7.4"]
18+
arch: [x64]
19+
ts: [ts,nts]
20+
ext: ["basic","igbinary","msgpack"]
21+
steps:
22+
- name: vc15
23+
if: matrix.version=='7.4'
24+
run: |
25+
echo "Vs=vc15" >> $env:GITHUB_ENV
26+
shell: powershell
27+
- name: vs16
28+
if: matrix.version!='7.4'
29+
run: |
30+
echo "Vs=vs16" >> $env:GITHUB_ENV
31+
shell: powershell
32+
- name: set env
33+
run: |
34+
echo ${{matrix.ext}}
35+
echo "vs env value is : $env:Vs "
36+
shell: powershell
37+
- name: set envs
38+
run: |
39+
echo "vs env value is : ${{env.Vs}} "
40+
- name: Setup PHP
41+
id: setup-php
42+
uses: cmb69/setup-php-sdk@v0.3
43+
with:
44+
version: ${{matrix.version}}
45+
arch: ${{matrix.arch}}
46+
ts: ${{matrix.ts}}
47+
deps: zlib
48+
- name: Enable Developer Command Prompt
49+
uses: ilammy/msvc-dev-cmd@v1
50+
with:
51+
arch: ${{matrix.arch}}
52+
toolset: ${{steps.setup-php.outputs.toolset}}
53+
- name: get phpsdktools
54+
run: |
55+
dir ../deps
56+
phpsdk_buildtree.bat ${{matrix.version}}-${{matrix.arch}}
57+
- name: get php source and deps
58+
shell: powershell
59+
run: |
60+
curl https://windows.php.net/downloads/releases/releases.json -o r.json
61+
$CLRJson = Get-Content -Raw -Path "r.json" | ConvertFrom-Json
62+
$version = $CLRJson.${{matrix.version}}.version
63+
echo "$version---aaaa"
64+
cd ${{matrix.version}}-${{matrix.arch}}/${{env.Vs}}/${{matrix.arch}}
65+
curl https://windows.php.net/downloads/releases/php-$version-src.zip -o ${{matrix.version}}-${{matrix.arch}}-${{matrix.ts}}-${{matrix.ext}}.zip
66+
7z x ${{matrix.version}}-${{matrix.arch}}-${{matrix.ts}}-${{matrix.ext}}.zip -o* -aoa
67+
dir
68+
cd ${{matrix.version}}-${{matrix.arch}}-${{matrix.ts}}-${{matrix.ext}}
69+
phpsdk_deps.bat -u
70+
curl https://github.com/lifenglsf/libmemcached-window-dll-lib/blob/main/${{matrix.arch}}.zip?raw=true -o ${{matrix.arch}}.zip
71+
7z x ${{matrix.arch}}.zip -o..\deps -aoa
72+
curl https://github.com/lifenglsf/php-memcached/archive/refs/heads/windows_msgpack_support.zip -o m.zip
73+
7z x m.zip -oext -aoa
74+
dir ..\deps /N /S
75+
# if(${{matrix.ext}} eq "igbinary"){
76+
# }
77+
78+
# - name: Checkout memcached
79+
# uses: actions/checkout@v3
80+
# with:
81+
# repository: lifenglsf/php-memcached
82+
# ref: ${{ env.ver }}
83+
# - name: Setup PHP
84+
# id: setup-php
85+
# uses: cmb69/setup-php-sdk@v0.3
86+
# with:
87+
# version: ${{matrix.version}}
88+
# arch: ${{matrix.arch}}
89+
# ts: ${{matrix.ts}}
90+
# deps: zlib
91+
# - name: Download deps
92+
# run: |
93+
# curl -L https://github.com/lifenglsf/libmemcached-window-dll-lib/blob/main/${{matrix.arch}}.zip?raw=true -o ${{matrix.arch}}.zip
94+
# 7z x ${{matrix.arch}}.zip -o..\deps
95+
# echo "stable version ${{ env.ver }}"
96+
# curl -L https://github.com/msgpack/msgpack-php/archive/refs/heads/master.zip -o msgpack.zip
97+
# 7z x msgpack.zip -o.\
98+
# xcopy /S /E msgpack-php-master ..\deps\include
99+
# md.\ext\msgpack
100+
# xcopy /S /E msgpack-php-master .\ext\msgpack
101+
# dir ext /N /S
102+
# curl -L https://windows.php.net/downloads/pecl/releases/msgpack/${{env.Mg}}/php_msgpack-${{env.Mg}}-${{matrix.version}}-${{matrix.ts}}-${{env.Vs}}-${{matrix.arch}}.zip -o msgpack-php.zip
103+
# 7z x msgpack-php.zip -o.\msgpack_dll
104+
# copy msgpack_dll\php_msgpack.dll ${{steps.setup-php.outputs.prefix}}\ext
105+
106+
# - name: Enable Developer Command Prompt
107+
# uses: ilammy/msvc-dev-cmd@v1
108+
# with:
109+
# arch: ${{matrix.arch}}
110+
# toolset: ${{steps.setup-php.outputs.toolset}}
111+
# - name: phpize
112+
# run: |
113+
# phpize
114+
# - name: configure
115+
# run: |
116+
# configure --enable-memcached=shared --enable-memcached-session --enable-memcached-json --enable-memcached-msgpack --enable-msgpack=shared --with-php-build=..\deps --with-prefix=${{steps.setup-php.outputs.prefix}} --with-config-file-path=${{steps.setup-php.outputs.prefix}}
117+
# - name: make
118+
# run: nmake
119+
# - name: make install
120+
# run: nmake install
121+
# - name: copy ini
122+
# run: copy ${{steps.setup-php.outputs.prefix}}\php.ini-development ${{steps.setup-php.outputs.prefix}}\php.ini
123+
# - name: copy libmemcached
124+
# run: copy ..\deps\bin\libmemcached.dll ${{steps.setup-php.outputs.prefix}}
125+
# - name: set extension dir
126+
# run : echo extension_dir="${{steps.setup-php.outputs.prefix}}\ext"; >>${{steps.setup-php.outputs.prefix}}\php.ini
127+
# - name: show file
128+
# run: dir ${{steps.setup-php.outputs.prefix}} /N /S
129+
# - name: extension path
130+
# run: php -i|grep "extension_dir"
131+
# - name: add memcached msgpack ext
132+
# run : |
133+
# echo extension=msgpack; >>${{steps.setup-php.outputs.prefix}}\php.ini
134+
# echo extension=memcached; >>${{steps.setup-php.outputs.prefix}}\php.ini
135+
# - name: show ini config
136+
# run: php --ini
137+
# - name: php module
138+
# run: php -m
139+
# - name: copy file
140+
# run: |
141+
# mkdir -p ${{github.workspace}}\php-${{matrix.version}}-${{matrix.arch}}-${{matrix.ts}}
142+
# copy ..\deps\bin\libmemcached.dll ${{ github.workspace }}\php-${{matrix.version}}-${{matrix.arch}}-${{matrix.ts}}
143+
# copy ${{steps.setup-php.outputs.prefix}}\ext\php_memcached.dll ${{ github.workspace }}\php-${{matrix.version}}-${{matrix.arch}}-${{matrix.ts}}
144+
# dir ${{ github.workspace }} /N /S
145+
# 7z a ${{ github.workspace }}\php-${{ env.Ver }}-${{matrix.version}}-${{matrix.arch}}-${{matrix.ts}}.7z ${{ github.workspace }}\php-${{matrix.version}}-${{matrix.arch}}-${{matrix.ts}}\*.*
146+
147+
# #- name: test
148+
# # run: nmake test
149+
# # - name: Accidentally upload to the same artifact via multiple jobs
150+
# # uses: actions/upload-artifact@v3
151+
# # with:
152+
# # name: php-${{ env.Ver }}-${{matrix.version}}-${{matrix.arch}}-${{matrix.ts}}
153+
# # path: ${{ github.workspace }}\php-${{ env.Ver }}-${{matrix.version}}-${{matrix.arch}}-${{matrix.ts}}.7z
154+
# create_tag:
155+
# needs: [ts74-x64-msgpack]
156+
# defaults:
157+
# run:
158+
# shell: cmd
159+
# runs-on: windows-2019
160+
# steps:
161+
# - name : download artifact
162+
# uses: marcofaggian/action-download-multiple-artifacts@v3.0.7
163+
# with:
164+
# names: php-${{ env.Ver }}-7.4-x64-ts php-${{ env.Ver }}-8.0-x64-ts php-${{ env.Ver }}-8.1-x64-ts php-${{ env.Ver }}-7.4-x64-nts php-${{ env.Ver }}-8.0-x64-nts php-${{ env.Ver }}-8.1-x64-nts php-${{ env.Ver }}-7.4-x86-nts php-${{ env.Ver }}-8.0-x86-nts php-${{ env.Ver }}-8.1-x86-nts php-${{ env.Ver }}-7.4-x86-ts php-${{ env.Ver }}-8.0-x86-ts php-${{ env.Ver }}-8.1-x86-ts
165+
# paths: ${{ github.workspace }} ${{ github.workspace }} ${{ github.workspace }} ${{ github.workspace }} ${{ github.workspace }} ${{ github.workspace }} ${{ github.workspace }} ${{ github.workspace }} ${{ github.workspace }} ${{ github.workspace }} ${{ github.workspace }} ${{ github.workspace }}
166+
# #- name: delete_tag
167+
# # uses: dev-drprasad/delete-tag-and-release@v0.2.0
168+
# # with:
169+
# # delete_release: true # default: false
170+
# # tag_name: ${{ env.Ver }} # tag name to delete
171+
# # env:
172+
# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
173+
# #- name: create release
174+
# # uses: ncipollo/release-action@v1
175+
# # with:
176+
# # artifacts: "${{github.workspace}}\\php-${{ env.Ver }}-7.4-x64-ts.7z,${{github.workspace}}\\php-${{ env.Ver }}-8.0-x64-ts.7z,${{github.workspace}}\\php-${{ env.Ver }}-8.1-x64-ts.7z,${{github.workspace}}\\php-${{ env.Ver }}-7.4-x64-nts.7z,${{github.workspace}}\\php-${{ env.Ver }}-8.0-x64-nts.7z,${{github.workspace}}\\php-${{ env.Ver }}-8.1-x64-nts.7z,${{github.workspace}}\\php-${{ env.Ver }}-7.4-x86-ts.7z,${{github.workspace}}\\php-${{ env.Ver }}-8.0-x86-ts.7z,${{github.workspace}}\\php-${{ env.Ver }}-8.1-x86-ts.7z,${{github.workspace}}\\php-${{ env.Ver }}-7.4-x86-nts.7z,${{github.workspace}}\\php-${{ env.Ver }}-8.0-x86-nts.7z,${{github.workspace}}\\php-${{ env.Ver }}-8.1-x86-nts.7z"
177+
# # token: ${{ secrets.GITHUB_TOKEN }}
178+
# # tag: ${{ env.Ver }}

0 commit comments

Comments
 (0)