Skip to content
Open
62 changes: 57 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ 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
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -27,16 +27,25 @@ 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
steps:
- name: Checkout dio
uses: actions/checkout@v2
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
uses: php/setup-php-sdk@v0.10
with:
version: ${{matrix.version}}
arch: ${{matrix.arch}}
Expand All @@ -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.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 ('8.4' -eq '${{matrix.version}}') { $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
echo $extension_artifact_name

$from = $dir + '\php_dio.dll'
$to = $from + ".zip"
Compress-Archive $from $to
$extension_artifact = "ARTIFACT=" + $from
echo $extension_artifact >> $env:GITHUB_ENV
echo $extension_artifact

- 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