From f0a7dbc911a73c1b0ae1a9810b74d641590b7b1f Mon Sep 17 00:00:00 2001 From: Fernando Herrero Date: Mon, 26 Feb 2024 12:00:15 +0100 Subject: [PATCH 01/16] Build Action --- .github/workflows/build.yml | 97 +++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..34550f1 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,97 @@ +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 src/php_dio.h -Pattern 'PHP_DIO_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}} + - 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-dio --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_dio-${{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_dio.dll' + $to = $dir + '\' + $artifact_name + ".dll" + Copy-Item $from -Destination $to + $extension_artifact = "ARTIFACT=" + $to + echo $extension_artifact >> $env:GITHUB_ENV + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + 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}}.dll + file: ${{env.ARTIFACT}} From 29953c1e553c9a492234ddb1e8c5ba5c2c23ff32 Mon Sep 17 00:00:00 2001 From: Fernando Herrero Date: Mon, 26 Feb 2024 12:14:04 +0100 Subject: [PATCH 02/16] Fix matrix --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 34550f1..ebc17e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,9 +18,9 @@ jobs: strategy: fail-fast: false matrix: - php: ["7.3", "7.4", "8.0", "8.1", "8.2", "8.3"] - arch: [x86, x64] - ts: [nts, ts] + php: ["8.0", "8.1", "8.2", "8.3"] + arch: [x64] + ts: [ts] experimental: [false] steps: - name: Checkout Repository @@ -49,7 +49,7 @@ jobs: - name: Generate Build Files run: phpize - name: Configure Build - run: configure --with-dio --with-prefix=${{steps.setup-php.outputs.prefix}} + run: configure --enable-dio --with-prefix=${{steps.setup-php.outputs.prefix}} - name: Build run: nmake - name: Define Module Env From fd4ceaf6affe16ef26436e0e93cf440c2bb40072 Mon Sep 17 00:00:00 2001 From: Fernando Herrero Date: Mon, 26 Feb 2024 12:24:18 +0100 Subject: [PATCH 03/16] Run on create release only --- .github/workflows/build.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ebc17e3..4b06759 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,6 @@ -name: Build +name: Build artifacts on: - push: - branches: [master] - pull_request: release: types: [created] create: From f34d2a90591855ce8515c04dccf900d7e0b87b6b Mon Sep 17 00:00:00 2001 From: Fernando Herrero Date: Mon, 26 Feb 2024 12:28:03 +0100 Subject: [PATCH 04/16] Update actions/checkout in ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e46a569..746d406 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: runs-on: windows-latest steps: - name: Checkout dio - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup PHP id: setup-php uses: php/setup-php-sdk@v0.8 From 44daab956dbcf6f4395e2481aecdc45fa3ed3b54 Mon Sep 17 00:00:00 2001 From: Fernando Herrero Date: Mon, 26 Feb 2024 12:30:11 +0100 Subject: [PATCH 05/16] Update also in Ubuntu section --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 746d406..3e163f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout dio - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: From 45409b4be8958f263def347ea4b265b42f5f42ef Mon Sep 17 00:00:00 2001 From: Fernando Herrero Date: Mon, 26 Feb 2024 12:48:56 +0100 Subject: [PATCH 06/16] Remove build.yml, integrate upload artifacts in ci.yml --- .github/workflows/build.yml | 94 ------------------------------------- .github/workflows/ci.yml | 52 ++++++++++++++++++++ 2 files changed, 52 insertions(+), 94 deletions(-) delete mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 4b06759..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,94 +0,0 @@ -name: Build artifacts - -on: - 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: ["8.0", "8.1", "8.2", "8.3"] - arch: [x64] - ts: [ts] - experimental: [false] - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - name: Extract Version - shell: powershell - run: | - chcp 65001 - $r = Select-String -Path src/php_dio.h -Pattern 'PHP_DIO_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}} - - 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 --enable-dio --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_dio-${{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_dio.dll' - $to = $dir + '\' + $artifact_name + ".dll" - Copy-Item $from -Destination $to - $extension_artifact = "ARTIFACT=" + $to - echo $extension_artifact >> $env:GITHUB_ENV - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - 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}}.dll - file: ${{env.ARTIFACT}} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e163f8..ba227cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,6 +34,15 @@ jobs: steps: - name: Checkout dio uses: actions/checkout@v4 + - name: Extract Version + shell: powershell + run: | + chcp 65001 + $r = Select-String -Path src/php_dio.h -Pattern 'PHP_DIO_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 @@ -54,3 +63,46 @@ jobs: run: nmake - name: test run: nmake test TESTS="tests --show-diff" + - 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_dio-${{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_dio.dll' + $to = $dir + '\' + $artifact_name + ".dll" + Copy-Item $from -Destination $to + $extension_artifact = "ARTIFACT=" + $to + echo $extension_artifact >> $env:GITHUB_ENV + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + 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}}.dll + file: ${{env.ARTIFACT}} From 13a2b770000211203faa2c8b4ed6be565a740811 Mon Sep 17 00:00:00 2001 From: Fernando Herrero Date: Mon, 26 Feb 2024 12:55:24 +0100 Subject: [PATCH 07/16] Update to actions/upload-artifact@v4 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba227cc..dc1e70e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,7 +96,7 @@ jobs: 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}} From c66d2e0cc4b541930fab40ff7f07ac01625598bb Mon Sep 17 00:00:00 2001 From: Fernando Herrero Date: Mon, 26 Feb 2024 13:01:32 +0100 Subject: [PATCH 08/16] Define env before test --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc1e70e..66f6a25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,8 +61,6 @@ jobs: run: configure --enable-dio --with-prefix=${{steps.setup-php.outputs.prefix}} - name: make run: nmake - - name: test - run: nmake test TESTS="tests --show-diff" - name: Define Module Env shell: powershell run: | @@ -94,6 +92,8 @@ jobs: Copy-Item $from -Destination $to $extension_artifact = "ARTIFACT=" + $to echo $extension_artifact >> $env:GITHUB_ENV + - name: test + run: nmake test TESTS="tests --show-diff" - name: Upload artifacts uses: actions/upload-artifact@v4 From 59333ecffe17b343ac2d3038704ee8f73067b62f Mon Sep 17 00:00:00 2001 From: Fernando Herrero Date: Mon, 26 Feb 2024 13:14:07 +0100 Subject: [PATCH 09/16] test --- .github/workflows/ci.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66f6a25..658b391 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ jobs: ubuntu: strategy: matrix: - version: ['8.0', '8.1', '8.2', '8.3'] + version: ['8.3'] runs-on: ubuntu-latest steps: - name: Checkout dio @@ -27,7 +27,7 @@ jobs: shell: cmd strategy: matrix: - version: ['8.0', '8.1', '8.2', '8.3'] + version: ['8.2', '8.3'] arch: [x64] ts: [ts] runs-on: windows-latest @@ -61,6 +61,8 @@ jobs: run: configure --enable-dio --with-prefix=${{steps.setup-php.outputs.prefix}} - name: make run: nmake + - name: test + run: nmake test TESTS="tests --show-diff" - name: Define Module Env shell: powershell run: | @@ -73,9 +75,6 @@ jobs: $artifact_name = 'php_dio-${{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' } @@ -85,15 +84,15 @@ jobs: if ('x64' -eq '${{matrix.arch}}') { $artifact_name = $artifact_name + '-x86_64' } $extension_artifact_name = "ARTIFACT_NAME=" + $artifact_name + echo $extension_artifact_name echo $extension_artifact_name >> $env:GITHUB_ENV $from = $dir + '\php_dio.dll' $to = $dir + '\' + $artifact_name + ".dll" Copy-Item $from -Destination $to $extension_artifact = "ARTIFACT=" + $to + echo $extension_artifact echo $extension_artifact >> $env:GITHUB_ENV - - name: test - run: nmake test TESTS="tests --show-diff" - name: Upload artifacts uses: actions/upload-artifact@v4 From 8d3a4805c73849ef84b5f4f1caa9074b53792e8c Mon Sep 17 00:00:00 2001 From: Fernando Herrero Date: Mon, 26 Feb 2024 13:36:11 +0100 Subject: [PATCH 10/16] Fix artfifact name --- .github/workflows/ci.yml | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 658b391..56e8817 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,15 @@ jobs: echo "$s" $extension_version = 'EXTENSION_VERSION=' + $s echo $extension_version >> $env:GITHUB_ENV + $artifact_name = 'php_dio-' + $extension_version + '-' + '${{matrix.php}}' + 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 - name: Setup PHP id: setup-php uses: php/setup-php-sdk@v0.8 @@ -67,33 +76,15 @@ jobs: 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_dio-${{env.EXTENSION_VERSION}}-${{matrix.php}}' - - 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 - echo $extension_artifact_name >> $env:GITHUB_ENV - $from = $dir + '\php_dio.dll' - $to = $dir + '\' + $artifact_name + ".dll" + $to = $dir + '\${{env.ARTIFACT_NAME}}.dll' Copy-Item $from -Destination $to $extension_artifact = "ARTIFACT=" + $to - echo $extension_artifact echo $extension_artifact >> $env:GITHUB_ENV - - name: Upload artifacts uses: actions/upload-artifact@v4 with: From 67fb887a5024b07ba7364583efa1b06da003e3e2 Mon Sep 17 00:00:00 2001 From: Fernando Herrero Date: Mon, 26 Feb 2024 13:56:18 +0100 Subject: [PATCH 11/16] Fix --- .github/workflows/ci.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56e8817..a1ae721 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,18 +40,22 @@ jobs: chcp 65001 $r = Select-String -Path src/php_dio.h -Pattern 'PHP_DIO_VERSION\s+"(.*)"' $s = $r.Matches[0].Groups[1] - echo "$s" - $extension_version = 'EXTENSION_VERSION=' + $s - echo $extension_version >> $env:GITHUB_ENV $artifact_name = 'php_dio-' + $extension_version + '-' + '${{matrix.php}}' + 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 + echo $extension_artifact_name + $extension_version = 'EXTENSION_VERSION=' + $s + echo $extension_version >> $env:GITHUB_ENV + echo $extension_version - name: Setup PHP id: setup-php uses: php/setup-php-sdk@v0.8 @@ -76,15 +80,19 @@ jobs: 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' } + + $from = $dir + '\php_dio.dll' $to = $dir + '\${{env.ARTIFACT_NAME}}.dll' Copy-Item $from -Destination $to $extension_artifact = "ARTIFACT=" + $to echo $extension_artifact >> $env:GITHUB_ENV + - name: Upload artifacts uses: actions/upload-artifact@v4 with: From bc631b65b0dbd59dedafb4a0fd200b8c97e54209 Mon Sep 17 00:00:00 2001 From: Fernando Herrero Date: Mon, 26 Feb 2024 14:04:04 +0100 Subject: [PATCH 12/16] Artifact name fixed --- .github/workflows/ci.yml | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1ae721..b92f8b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ jobs: ubuntu: strategy: matrix: - version: ['8.3'] + version: ['8.0', '8.1', '8.2', '8.3'] runs-on: ubuntu-latest steps: - name: Checkout dio @@ -27,7 +27,7 @@ jobs: shell: cmd strategy: matrix: - version: ['8.2', '8.3'] + version: ['8.0', '8.1', '8.2', '8.3'] arch: [x64] ts: [ts] runs-on: windows-latest @@ -40,22 +40,9 @@ jobs: chcp 65001 $r = Select-String -Path src/php_dio.h -Pattern 'PHP_DIO_VERSION\s+"(.*)"' $s = $r.Matches[0].Groups[1] - $artifact_name = 'php_dio-' + $extension_version + '-' + '${{matrix.php}}' - - 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 - echo $extension_artifact_name + echo "$s" $extension_version = 'EXTENSION_VERSION=' + $s echo $extension_version >> $env:GITHUB_ENV - echo $extension_version - name: Setup PHP id: setup-php uses: php/setup-php-sdk@v0.8 @@ -86,12 +73,26 @@ jobs: $dir = $dir + 'Release' if ('ts' -eq '${{matrix.ts}}') { $dir = $dir + '_TS' } + $artifact_name = 'php_dio-${{env.EXTENSION_VERSION}}-${{matrix.version}}' + + if ('8.0' -eq '${{matrix.version}}') { $artifact_name = $artifact_name + '-vs16' } + if ('8.1' -eq '${{matrix.version}}') { $artifact_name = $artifact_name + '-vs16' } + if ('8.2' -eq '${{matrix.version}}') { $artifact_name = $artifact_name + '-vs16' } + if ('8.3' -eq '${{matrix.version}}') { $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 + echo $extension_artifact_name $from = $dir + '\php_dio.dll' - $to = $dir + '\${{env.ARTIFACT_NAME}}.dll' + $to = $dir + '\' + $artifact_name + ".dll" Copy-Item $from -Destination $to $extension_artifact = "ARTIFACT=" + $to echo $extension_artifact >> $env:GITHUB_ENV + echo $extension_artifact - name: Upload artifacts uses: actions/upload-artifact@v4 From d8d4ef2a38b4c101ee16a12b2380bd2a8d286f7f Mon Sep 17 00:00:00 2001 From: Fernando Herrero Date: Tue, 27 Feb 2024 10:17:00 +0100 Subject: [PATCH 13/16] Compressed artifacts --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b92f8b3..031b24b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,8 +88,8 @@ jobs: echo $extension_artifact_name $from = $dir + '\php_dio.dll' - $to = $dir + '\' + $artifact_name + ".dll" - Copy-Item $from -Destination $to + $to = $dir + '\' + $artifact_name + ".zip" + Compress-Archive $from $to $extension_artifact = "ARTIFACT=" + $to echo $extension_artifact >> $env:GITHUB_ENV echo $extension_artifact From e1e353fd894c249bc340a36495d5c6c03866a2c4 Mon Sep 17 00:00:00 2001 From: Fernando Herrero Date: Tue, 27 Feb 2024 11:15:56 +0100 Subject: [PATCH 14/16] Publish artifacts as zip --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 031b24b..db13254 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,9 +88,9 @@ jobs: echo $extension_artifact_name $from = $dir + '\php_dio.dll' - $to = $dir + '\' + $artifact_name + ".zip" + $to = $from + ".zip" Compress-Archive $from $to - $extension_artifact = "ARTIFACT=" + $to + $extension_artifact = "ARTIFACT=" + $from echo $extension_artifact >> $env:GITHUB_ENV echo $extension_artifact @@ -103,5 +103,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 9d91083d17936f52652f3253248a681594d5ffff Mon Sep 17 00:00:00 2001 From: Fernando Herrero Date: Tue, 27 Feb 2024 20:48:24 +0100 Subject: [PATCH 15/16] Normalize artifacts names --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db13254..2370058 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,13 +75,16 @@ jobs: $artifact_name = 'php_dio-${{env.EXTENSION_VERSION}}-${{matrix.version}}' + if ('ts' -eq '${{matrix.ts}}') { $artifact_name = $artifact_name + '-ts' } + if ('nts' -eq '${{matrix.ts}}') { $artifact_name = $artifact_name + '-nts' } + if ('8.0' -eq '${{matrix.version}}') { $artifact_name = $artifact_name + '-vs16' } if ('8.1' -eq '${{matrix.version}}') { $artifact_name = $artifact_name + '-vs16' } if ('8.2' -eq '${{matrix.version}}') { $artifact_name = $artifact_name + '-vs16' } if ('8.3' -eq '${{matrix.version}}') { $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' } + if ('x64' -eq '${{matrix.arch}}') { $artifact_name = $artifact_name + '-x64' } + if ('x86' -eq '${{matrix.arch}}') { $artifact_name = $artifact_name + '-x86' } $extension_artifact_name = "ARTIFACT_NAME=" + $artifact_name echo $extension_artifact_name >> $env:GITHUB_ENV From a214723e586ba89e96337b510eacacf98e2e7dfa Mon Sep 17 00:00:00 2001 From: Fernando Herrero Date: Thu, 28 Nov 2024 11:47:13 +0100 Subject: [PATCH 16/16] Added php-8.4 branch --- .github/workflows/ci.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2370058..ca61a1c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ jobs: ubuntu: strategy: matrix: - version: ['8.0', '8.1', '8.2', '8.3'] + version: ['8.0', '8.1', '8.2', '8.3', '8.4'] runs-on: ubuntu-latest steps: - name: Checkout dio @@ -27,7 +27,7 @@ jobs: shell: cmd strategy: matrix: - version: ['8.0', '8.1', '8.2', '8.3'] + version: ['8.0', '8.1', '8.2', '8.3', '8.4'] arch: [x64] ts: [ts] runs-on: windows-latest @@ -45,7 +45,7 @@ jobs: echo $extension_version >> $env:GITHUB_ENV - name: Setup PHP id: setup-php - uses: php/setup-php-sdk@v0.8 + uses: php/setup-php-sdk@v0.10 with: version: ${{matrix.version}} arch: ${{matrix.arch}} @@ -75,16 +75,14 @@ jobs: $artifact_name = 'php_dio-${{env.EXTENSION_VERSION}}-${{matrix.version}}' - if ('ts' -eq '${{matrix.ts}}') { $artifact_name = $artifact_name + '-ts' } - if ('nts' -eq '${{matrix.ts}}') { $artifact_name = $artifact_name + '-nts' } - if ('8.0' -eq '${{matrix.version}}') { $artifact_name = $artifact_name + '-vs16' } if ('8.1' -eq '${{matrix.version}}') { $artifact_name = $artifact_name + '-vs16' } if ('8.2' -eq '${{matrix.version}}') { $artifact_name = $artifact_name + '-vs16' } if ('8.3' -eq '${{matrix.version}}') { $artifact_name = $artifact_name + '-vs16' } + if ('8.4' -eq '${{matrix.version}}') { $artifact_name = $artifact_name + '-vs17' } - if ('x64' -eq '${{matrix.arch}}') { $artifact_name = $artifact_name + '-x64' } - if ('x86' -eq '${{matrix.arch}}') { $artifact_name = $artifact_name + '-x86' } + 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