From 01e0af0d67a8297e0ae88eb0b4f248cdb6e35797 Mon Sep 17 00:00:00 2001 From: Fernando Herrero Date: Tue, 27 Feb 2024 13:37:02 +0100 Subject: [PATCH 1/3] Publish artifacts as zip --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 198095a..2115011 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,13 +80,13 @@ jobs: echo $extension_artifact_name >> $env:GITHUB_ENV $from = $dir + '\php_ssh2.dll' - $to = $dir + '\' + $artifact_name + ".dll" - Copy-Item $from -Destination $to - $extension_artifact = "ARTIFACT=" + $to + $to = $from + ".zip" + Compress-Archive $from $to + $extension_artifact = "ARTIFACT=" + $from echo $extension_artifact >> $env:GITHUB_ENV - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{env.ARTIFACT_NAME}} path: ${{env.ARTIFACT}} @@ -94,5 +94,5 @@ jobs: if: ${{ startsWith(github.ref, 'refs/tags') }} uses: svenstaro/upload-release-action@v2 with: - asset_name: ${{env.ARTIFACT_NAME}}.dll - file: ${{env.ARTIFACT}} + asset_name: ${{env.ARTIFACT_NAME}}.zip + file: ${{env.ARTIFACT}}.zip From 209bb1890d71aedc7f8c9f1a81f8f552e8d7e4b4 Mon Sep 17 00:00:00 2001 From: Fernando Herrero Date: Thu, 28 Nov 2024 12:19:58 +0100 Subject: [PATCH 2/3] Added php-8.4 branch --- .github/workflows/build.yml | 197 ++++++++++++++++++------------------ 1 file changed, 99 insertions(+), 98 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2115011..cfc4677 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,98 +1,99 @@ -name: Build - -on: - push: - branches: [master] - pull_request: - release: - types: [created] - create: - -jobs: - windows: - runs-on: windows-latest - name: "Windows: Build and test" - defaults: - run: - shell: cmd - strategy: - fail-fast: false - matrix: - php: ["7.3", "7.4", "8.0", "8.1", "8.2", "8.3"] - arch: [x86, x64] - ts: [nts, ts] - experimental: [false] - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - name: Extract Version - shell: powershell - run: | - chcp 65001 - $r = Select-String -Path php_ssh2.h -Pattern 'PHP_SSH2_VERSION\s+"(.*)"' - $s = $r.Matches[0].Groups[1] - echo "$s" - $extension_version = 'EXTENSION_VERSION=' + $s - echo $extension_version >> $env:GITHUB_ENV - - name: Setup PHP - id: setup-php - uses: php/setup-php-sdk@v0.8 - with: - version: ${{matrix.php}} - arch: ${{matrix.arch}} - ts: ${{matrix.ts}} - deps: "libssh2,openssl,zlib" - - name: Enable Developer Command Prompt - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: ${{matrix.arch}} - toolset: ${{steps.setup-php.outputs.toolset}} - - name: Generate Build Files - run: phpize - - name: Configure Build - run: configure --with-ssh2 --with-prefix=${{steps.setup-php.outputs.prefix}} - - name: Build - run: nmake - - name: Define Module Env - shell: powershell - run: | - chcp 65001 - - $dir = (Get-Location).Path + '\' - if ('x64' -eq '${{matrix.arch}}') { $dir = $dir + 'x64\' } - $dir = $dir + 'Release' - if ('ts' -eq '${{matrix.ts}}') { $dir = $dir + '_TS' } - - $artifact_name = 'php_ssh2-${{env.EXTENSION_VERSION}}-${{matrix.php}}' - - if ('7.2' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vc15' } - if ('7.3' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vc15' } - if ('7.4' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vc15' } - if ('8.0' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vs16' } - if ('8.1' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vs16' } - if ('8.2' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vs16' } - if ('8.3' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vs16' } - - if ('nts' -eq '${{matrix.ts}}') { $artifact_name = $artifact_name + '-nts' } - if ('x64' -eq '${{matrix.arch}}') { $artifact_name = $artifact_name + '-x86_64' } - - $extension_artifact_name = "ARTIFACT_NAME=" + $artifact_name - echo $extension_artifact_name >> $env:GITHUB_ENV - - $from = $dir + '\php_ssh2.dll' - $to = $from + ".zip" - Compress-Archive $from $to - $extension_artifact = "ARTIFACT=" + $from - echo $extension_artifact >> $env:GITHUB_ENV - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: ${{env.ARTIFACT_NAME}} - path: ${{env.ARTIFACT}} - - name: Publish Binaries to Release - if: ${{ startsWith(github.ref, 'refs/tags') }} - uses: svenstaro/upload-release-action@v2 - with: - asset_name: ${{env.ARTIFACT_NAME}}.zip - file: ${{env.ARTIFACT}}.zip +name: Build + +on: + push: + branches: [master] + pull_request: + release: + types: [created] + create: + +jobs: + windows: + runs-on: windows-latest + name: "Windows: Build and test" + defaults: + run: + shell: cmd + strategy: + fail-fast: false + matrix: + php: ["7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4"] + arch: [x86, x64] + ts: [nts, ts] + experimental: [false] + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Extract Version + shell: powershell + run: | + chcp 65001 + $r = Select-String -Path php_ssh2.h -Pattern 'PHP_SSH2_VERSION\s+"(.*)"' + $s = $r.Matches[0].Groups[1] + echo "$s" + $extension_version = 'EXTENSION_VERSION=' + $s + echo $extension_version >> $env:GITHUB_ENV + - name: Setup PHP + id: setup-php + uses: php/setup-php-sdk@v0.10 + with: + version: ${{matrix.php}} + arch: ${{matrix.arch}} + ts: ${{matrix.ts}} + deps: "libssh2,openssl,zlib" + - name: Enable Developer Command Prompt + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{matrix.arch}} + toolset: ${{steps.setup-php.outputs.toolset}} + - name: Generate Build Files + run: phpize + - name: Configure Build + run: configure --with-ssh2 --with-prefix=${{steps.setup-php.outputs.prefix}} + - name: Build + run: nmake + - name: Define Module Env + shell: powershell + run: | + chcp 65001 + + $dir = (Get-Location).Path + '\' + if ('x64' -eq '${{matrix.arch}}') { $dir = $dir + 'x64\' } + $dir = $dir + 'Release' + if ('ts' -eq '${{matrix.ts}}') { $dir = $dir + '_TS' } + + $artifact_name = 'php_ssh2-${{env.EXTENSION_VERSION}}-${{matrix.php}}' + + if ('7.2' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vc15' } + if ('7.3' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vc15' } + if ('7.4' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vc15' } + if ('8.0' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vs16' } + if ('8.1' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vs16' } + if ('8.2' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vs16' } + if ('8.3' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vs16' } + if ('8.4' -eq '${{matrix.php}}') { $artifact_name = $artifact_name + '-vs17' } + + if ('nts' -eq '${{matrix.ts}}') { $artifact_name = $artifact_name + '-nts' } + if ('x64' -eq '${{matrix.arch}}') { $artifact_name = $artifact_name + '-x86_64' } + + $extension_artifact_name = "ARTIFACT_NAME=" + $artifact_name + echo $extension_artifact_name >> $env:GITHUB_ENV + + $from = $dir + '\php_ssh2.dll' + $to = $from + ".zip" + Compress-Archive $from $to + $extension_artifact = "ARTIFACT=" + $from + echo $extension_artifact >> $env:GITHUB_ENV + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{env.ARTIFACT_NAME}} + path: ${{env.ARTIFACT}} + - name: Publish Binaries to Release + if: ${{ startsWith(github.ref, 'refs/tags') }} + uses: svenstaro/upload-release-action@v2 + with: + asset_name: ${{env.ARTIFACT_NAME}}.zip + file: ${{env.ARTIFACT}}.zip From 3684b9beb035d5a7cfd7dd97f7d2c57635982baf Mon Sep 17 00:00:00 2001 From: Fernando Herrero Date: Thu, 28 Nov 2024 12:31:55 +0100 Subject: [PATCH 3/3] Remove php-7.x branches --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cfc4677..bd9adc1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - php: ["7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4"] + php: ["8.0", "8.1", "8.2", "8.3", "8.4"] arch: [x86, x64] ts: [nts, ts] experimental: [false]