|
| 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