|
1 | | -name: Build |
2 | | - |
3 | | -on: |
4 | | - push: |
5 | | - branches: [master] |
6 | | - pull_request: |
7 | | - release: |
8 | | - types: [created] |
9 | | - create: |
10 | | - |
11 | | -jobs: |
12 | | - windows: |
13 | | - runs-on: windows-latest |
14 | | - name: "Windows: Build and test" |
15 | | - defaults: |
16 | | - run: |
17 | | - shell: cmd |
18 | | - strategy: |
19 | | - fail-fast: false |
20 | | - matrix: |
21 | | - php: ["7.3", "7.4", "8.0", "8.1", "8.2", "8.3"] |
22 | | - arch: [x86, x64] |
23 | | - ts: [nts, ts] |
24 | | - experimental: [false] |
25 | | - steps: |
26 | | - - name: Checkout Repository |
27 | | - uses: actions/checkout@v4 |
28 | | - - name: Extract Version |
29 | | - shell: powershell |
30 | | - run: | |
31 | | - chcp 65001 |
32 | | - $r = Select-String -Path php_ssh2.h -Pattern 'PHP_SSH2_VERSION\s+"(.*)"' |
33 | | - $s = $r.Matches[0].Groups[1] |
34 | | - echo "$s" |
35 | | - $extension_version = 'EXTENSION_VERSION=' + $s |
36 | | - echo $extension_version >> $env:GITHUB_ENV |
37 | | - - name: Setup PHP |
38 | | - id: setup-php |
39 | | - |
40 | | - with: |
41 | | - version: ${{matrix.php}} |
42 | | - arch: ${{matrix.arch}} |
43 | | - ts: ${{matrix.ts}} |
44 | | - deps: "libssh2,openssl,zlib" |
45 | | - - name: Enable Developer Command Prompt |
46 | | - uses: ilammy/msvc-dev-cmd@v1 |
47 | | - with: |
48 | | - arch: ${{matrix.arch}} |
49 | | - toolset: ${{steps.setup-php.outputs.toolset}} |
50 | | - - name: Generate Build Files |
51 | | - run: phpize |
52 | | - - name: Configure Build |
53 | | - run: configure --with-ssh2 --with-prefix=${{steps.setup-php.outputs.prefix}} |
54 | | - - name: Build |
55 | | - run: nmake |
56 | | - - name: Define Module Env |
57 | | - shell: powershell |
58 | | - run: | |
59 | | - chcp 65001 |
60 | | -
|
61 | | - $dir = (Get-Location).Path + '\' |
62 | | - if ('x64' -eq '${{matrix.arch}}') { $dir = $dir + 'x64\' } |
63 | | - $dir = $dir + 'Release' |
64 | | - if ('ts' -eq '${{matrix.ts}}') { $dir = $dir + '_TS' } |
65 | | -
|
66 | | - $artifact_name = 'php_ssh2-${{env.EXTENSION_VERSION}}-${{matrix.php}}' |
67 | | -
|
68 | | - if ('7.2' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vc15' } |
69 | | - if ('7.3' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vc15' } |
70 | | - if ('7.4' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vc15' } |
71 | | - if ('8.0' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vs16' } |
72 | | - if ('8.1' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vs16' } |
73 | | - if ('8.2' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vs16' } |
74 | | - if ('8.3' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vs16' } |
75 | | -
|
76 | | - if ('nts' -eq '${{matrix.ts}}') { $artifact_name = $artifact_name + '-nts' } |
77 | | - if ('x64' -eq '${{matrix.arch}}') { $artifact_name = $artifact_name + '-x86_64' } |
78 | | -
|
79 | | - $extension_artifact_name = "ARTIFACT_NAME=" + $artifact_name |
80 | | - echo $extension_artifact_name >> $env:GITHUB_ENV |
81 | | -
|
82 | | - $from = $dir + '\php_ssh2.dll' |
83 | | - $to = $from + ".zip" |
84 | | - Compress-Archive $from $to |
85 | | - $extension_artifact = "ARTIFACT=" + $from |
86 | | - echo $extension_artifact >> $env:GITHUB_ENV |
87 | | -
|
88 | | - - name: Upload artifacts |
89 | | - uses: actions/upload-artifact@v4 |
90 | | - with: |
91 | | - name: ${{env.ARTIFACT_NAME}} |
92 | | - path: ${{env.ARTIFACT}} |
93 | | - - name: Publish Binaries to Release |
94 | | - if: ${{ startsWith(github.ref, 'refs/tags') }} |
95 | | - uses: svenstaro/upload-release-action@v2 |
96 | | - with: |
97 | | - asset_name: ${{env.ARTIFACT_NAME}}.zip |
98 | | - file: ${{env.ARTIFACT}}.zip |
| 1 | +name: Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [master] |
| 6 | + pull_request: |
| 7 | + release: |
| 8 | + types: [created] |
| 9 | + create: |
| 10 | + |
| 11 | +jobs: |
| 12 | + windows: |
| 13 | + runs-on: windows-latest |
| 14 | + name: "Windows: Build and test" |
| 15 | + defaults: |
| 16 | + run: |
| 17 | + shell: cmd |
| 18 | + strategy: |
| 19 | + fail-fast: false |
| 20 | + matrix: |
| 21 | + php: ["7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4"] |
| 22 | + arch: [x86, x64] |
| 23 | + ts: [nts, ts] |
| 24 | + experimental: [false] |
| 25 | + steps: |
| 26 | + - name: Checkout Repository |
| 27 | + uses: actions/checkout@v4 |
| 28 | + - name: Extract Version |
| 29 | + shell: powershell |
| 30 | + run: | |
| 31 | + chcp 65001 |
| 32 | + $r = Select-String -Path php_ssh2.h -Pattern 'PHP_SSH2_VERSION\s+"(.*)"' |
| 33 | + $s = $r.Matches[0].Groups[1] |
| 34 | + echo "$s" |
| 35 | + $extension_version = 'EXTENSION_VERSION=' + $s |
| 36 | + echo $extension_version >> $env:GITHUB_ENV |
| 37 | + - name: Setup PHP |
| 38 | + id: setup-php |
| 39 | + |
| 40 | + with: |
| 41 | + version: ${{matrix.php}} |
| 42 | + arch: ${{matrix.arch}} |
| 43 | + ts: ${{matrix.ts}} |
| 44 | + deps: "libssh2,openssl,zlib" |
| 45 | + - name: Enable Developer Command Prompt |
| 46 | + uses: ilammy/msvc-dev-cmd@v1 |
| 47 | + with: |
| 48 | + arch: ${{matrix.arch}} |
| 49 | + toolset: ${{steps.setup-php.outputs.toolset}} |
| 50 | + - name: Generate Build Files |
| 51 | + run: phpize |
| 52 | + - name: Configure Build |
| 53 | + run: configure --with-ssh2 --with-prefix=${{steps.setup-php.outputs.prefix}} |
| 54 | + - name: Build |
| 55 | + run: nmake |
| 56 | + - name: Define Module Env |
| 57 | + shell: powershell |
| 58 | + run: | |
| 59 | + chcp 65001 |
| 60 | +
|
| 61 | + $dir = (Get-Location).Path + '\' |
| 62 | + if ('x64' -eq '${{matrix.arch}}') { $dir = $dir + 'x64\' } |
| 63 | + $dir = $dir + 'Release' |
| 64 | + if ('ts' -eq '${{matrix.ts}}') { $dir = $dir + '_TS' } |
| 65 | +
|
| 66 | + $artifact_name = 'php_ssh2-${{env.EXTENSION_VERSION}}-${{matrix.php}}' |
| 67 | +
|
| 68 | + if ('7.2' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vc15' } |
| 69 | + if ('7.3' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vc15' } |
| 70 | + if ('7.4' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vc15' } |
| 71 | + if ('8.0' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vs16' } |
| 72 | + if ('8.1' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vs16' } |
| 73 | + if ('8.2' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vs16' } |
| 74 | + if ('8.3' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vs16' } |
| 75 | + if ('8.4' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vs17' } |
| 76 | +
|
| 77 | + if ('nts' -eq '${{matrix.ts}}') { $artifact_name = $artifact_name + '-nts' } |
| 78 | + if ('x64' -eq '${{matrix.arch}}') { $artifact_name = $artifact_name + '-x86_64' } |
| 79 | +
|
| 80 | + $extension_artifact_name = "ARTIFACT_NAME=" + $artifact_name |
| 81 | + echo $extension_artifact_name >> $env:GITHUB_ENV |
| 82 | +
|
| 83 | + $from = $dir + '\php_ssh2.dll' |
| 84 | + $to = $from + ".zip" |
| 85 | + Compress-Archive $from $to |
| 86 | + $extension_artifact = "ARTIFACT=" + $from |
| 87 | + echo $extension_artifact >> $env:GITHUB_ENV |
| 88 | +
|
| 89 | + - name: Upload artifacts |
| 90 | + uses: actions/upload-artifact@v4 |
| 91 | + with: |
| 92 | + name: ${{env.ARTIFACT_NAME}} |
| 93 | + path: ${{env.ARTIFACT}} |
| 94 | + - name: Publish Binaries to Release |
| 95 | + if: ${{ startsWith(github.ref, 'refs/tags') }} |
| 96 | + uses: svenstaro/upload-release-action@v2 |
| 97 | + with: |
| 98 | + asset_name: ${{env.ARTIFACT_NAME}}.zip |
| 99 | + file: ${{env.ARTIFACT}}.zip |
0 commit comments