Adding CI so we can build Windows DLLs

This commit is contained in:
Derick Rethans
2023-04-04 12:39:56 +01:00
parent c9a2eb1927
commit d37841a72b
2 changed files with 173 additions and 0 deletions

90
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,90 @@
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.2", "7.3", "7.4", "8.0", "8.1", "8.2"]
arch: [x86, x64]
ts: [nts, ts]
experimental: [false]
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Extract Version
shell: powershell
run: |
chcp 65001
$r = Select-String -Path php_timezonedb.h -Pattern 'PHP_TIMEZONEDB_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: cmb69/setup-php-sdk@679db664987b6f5de6ecc4732e9ce649a689e4e5
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-timezonedb --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_timezonedb-${{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 ('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_timezonedb.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@v2
with:
name: ${{env.ARTIFACT_NAME}}
path: ${{env.ARTIFACT}}

83
.gitignore vendored Normal file
View File

@@ -0,0 +1,83 @@
/.deps
/Makefile
/*.dep
/*.lo
/*.loT
/*.slo
/*.mk
/*.la
/.libs
src/*.dep
src/*.lo
src/*.loT
src/.libs
src/*/*.dep
src/*/*.lo
src/*/*.loT
src/*/.libs
/libs.mk
/ac*.m4
/build
/config.h
/config.h.in
/config.nice
/config.sub
/configure
/configure.ac
/configure.in
/config.status
/config.cache
/conftest
/conftest.c
/core
/dynlib.m4
/install-sh
/ltmain.sh
/include
/Makefile.fragments
/Makefile.global
/Makefile.objects
/missing
/mkinstalldirs
/modules
/scan_makefile_in.awk
/config.guess
/*sw*
/contrib/*sw*
tags
/config.log
/libtool
/Debug
/Release
/Debug_TS
/Release_TS
/*.plg
/*.patch
/*.tgz
/*.ncb
/*.opt
/*.dsw
/autom4te.cache
/run-tests-config.php
/run-tests.php
/tmp-php.ini
.svn
/*~
/*.rej
# Test files generated by `run-tests.php`
*.diff
*.mem
*.log
*.out
*.exp
*.swp
*.php
*.sh
phpt.*
/C:\\Windows\\Temp\\remote-log4.txt
# Exclude files we like
!php_xdebug.stub.php
!run-xdebug-tests.php
!make-release.php