Skip to content

Commit

Permalink
Added workflow for adding binaries to release
Browse files Browse the repository at this point in the history
  • Loading branch information
derickr committed Dec 14, 2023
1 parent 18b9168 commit ee58ca7
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Running Tests

on:
push:
Expand Down
102 changes: 102 additions & 0 deletions .github/workflows/windows-release-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Building Windows Release Binaries

on:
push:
tags:
- '*'

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: [nts, ts]
experimental: [false]
steps:
- name: Checkout Xdebug
uses: actions/checkout@v4
- name: Extract Xdebug Version
shell: powershell
run: |
chcp 65001
$r = Select-String -Path php_xdebug.h -Pattern 'XDEBUG_VERSION\s+"(.*)"'
$s = $r.Matches[0].Groups[1]
echo "$s"
$xdebug_version = 'XDEBUG_VERSION=' + $s
echo $xdebug_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: 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-xdebug --with-xdebug-compression --enable-debug-pack --with-prefix=${{steps.setup-php.outputs.prefix}}
- name: Build
run: nmake
- name: Define Xdebug 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' }
$xdebug_dll_opt = 'TEST_PHP_ARGS=-n -d zend_extension=' + $dir + '\php_xdebug.dll'
echo $xdebug_dll_opt >> $env:GITHUB_ENV
$artifact_name = 'php_xdebug-${{env.XDEBUG_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' }
$xdebug_artifact_name = "ARTIFACT_NAME=" + $artifact_name
echo $xdebug_artifact_name >> $env:GITHUB_ENV
$from = $dir + '\php_xdebug.dll'
$to = $dir + '\' + $artifact_name + ".dll"
Copy-Item $from -Destination $to
$xdebug_artifact = "ARTIFACT=" + $to
echo $xdebug_artifact >> $env:GITHUB_ENV
- name: Define Other Environment
shell: powershell
run: |
chcp 65001
echo "REPORT_EXIT_STATUS=1" >> $env:GITHUB_ENV
echo "TEST_PHP_EXECUTABLE=${{steps.setup-php.outputs.prefix}}\php.exe" >> $env:GITHUB_ENV
echo "TEMP=$((Get-Item -LiteralPath $Env:TEMP).FullName)" >> $env:GITHUB_ENV
echo "TMP=$((Get-Item -LiteralPath $Env:TMP).FullName)" >> $env:GITHUB_ENV
echo "XDEBUG_MODE=" >> $env:GITHUB_ENV
- name: Publish Binaries to Release
uses: svenstaro/upload-release-action@v2
with:
asset_name: ${{env.ARTIFACT_NAME}}
file: ${{env.ARTIFACT}}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{env.ARTIFACT_NAME}}
path: ${{env.ARTIFACT}}

0 comments on commit ee58ca7

Please sign in to comment.