1- name : ' Phalcon PHP extension build action'
1+ name : ' Phalcon PHP extension build action (Windows) '
22description : ' Build Phalcon Framework for Windows according to various PHP versions.'
33
44inputs :
55 pecl :
66 description : ' PECL package path'
77 required : true
8-
9- php_version :
10- description : ' PHP version to build for (e.g: 7.4, 8.0)'
8+ php-version :
9+ description : ' PHP version'
1110 required : true
1211 ts :
13- description : ' Thread Safety'
14- required : false
15- default : ' nts'
16- msvc :
17- description : ' Microsoft Visual C++ compiler toolset prefix (e.g: vc14, vs15, vs16)'
12+ description : ' Thread safety (nts or ts)'
13+ required : true
14+ compiler :
15+ description : ' MSVC compiler version'
1816 required : true
1917 arch :
20- description : ' Target architecture (x64, x86)'
21- required : false
22- default : ' x64'
18+ description : ' Architecture (x64)'
19+ required : true
20+ phalcon-version :
21+ description : ' Phalcon version'
22+ required : true
23+ tools-dir :
24+ description : ' Tools directory'
25+ required : true
26+ cache-dir :
27+ description : ' Cache directory'
28+ required : true
29+ os :
30+ description : ' OS name (e.g. windows-2019)'
31+ required : true
2332
2433runs :
2534 using : ' composite'
2635 steps :
2736 - name : Setup Downloads Cache
28- uses : actions/cache@v3
37+ uses : actions/cache@v5
2938 with :
30- path : ${{ env.CACHE_DIR }}
31- key : ${{ runner.os }} -downloads-${{ hashFiles('**/.github/actions/build-phalcon-win/action.yml') }}
39+ path : ${{ inputs.cache-dir }}
40+ key : Windows -downloads-${{ hashFiles('**/.github/actions/build-phalcon-win/action.yml') }}
3241 restore-keys : |
33- ${{ runner.os }}-downloads-${{ env.cache-name }}-
34- ${{ runner.os }}-downloads-
35- ${{ runner.os }}
42+ Windows-downloads-
3643
3744 - name : Setup Prerequisites
3845 shell : powershell
3946 run : |
4047 Write-Output "::group::Install dependencies"
41- choco install --no-progress -y --cache-location=${{ env.CACHE_DIR }}\Choco re2c
48+ choco install --no-progress -y --cache-location=${{ inputs.cache-dir }}\Choco re2c
4249 Write-Output "::endgroup::"
4350
4451 Write-Output "Install PowerShell PHP Manager module"
@@ -47,87 +54,77 @@ runs:
4754 } else {
4855 Install-Module -Name PhpManager -Repository PSGallery -Force
4956 }
50- Write-Output "::endgroup::"
5157
52- $OsName = "${{ matrix .os }}".replace('-','').ToLower()
58+ $OsName = "${{ inputs .os }}".replace('-','').ToLower()
5359 $ReleaseFolder = if ("${{ inputs.ts }}" -eq "ts") { "Release_TS" } else { "Release" }
5460 $ReleaseFolder = if ("${{ inputs.arch }}" -eq "x64") { "x64\${ReleaseFolder}" } else { "${ReleaseFolder}" }
55- $ReleaseDllPath = "${{ env.TOOLS_DIR }}\pecl\phalcon\phalcon-${{ env.PHALCON_VERSION }}\${ReleaseFolder}\php_phalcon.dll"
56- $ReleaseZipBall = "phalcon-php${{ inputs.php_version }}-${{ inputs.ts }}-${OsName}-${{ inputs.msvc } }-${{ inputs.arch }}"
61+ $ReleaseDllPath = "${{ inputs.tools-dir }}\pecl\phalcon\phalcon-${{ inputs.phalcon-version }}\${ReleaseFolder}\php_phalcon.dll"
62+ $ReleaseZipBall = "phalcon-php${{ inputs.php-version }}-${{ inputs.ts }}-${OsName}-${{ inputs.arch }}"
5763
5864 Write-Output "RELEASE_FOLDER=$ReleaseFolder" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
5965 Write-Output "RELEASE_DLL_PATH=$ReleaseDllPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
6066 Write-Output "RELEASE_ZIPBALL=$ReleaseZipBall" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
61-
62- Write-Output "PHP_ROOT=${{ env.TOOLS_DIR }}\php" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
63- Write-Output "PHP_PECL_PATH=${{ env.TOOLS_DIR }}\pecl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
64- Write-Output "PHP_DEVPACK=${{ env.TOOLS_DIR }}\php-devpack" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
67+ Write-Output "PHP_ROOT=${{ inputs.tools-dir }}\php" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
68+ Write-Output "PHP_PECL_PATH=${{ inputs.tools-dir }}\pecl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
69+ Write-Output "PHP_DEVPACK=${{ inputs.tools-dir }}\php-devpack" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
6570
6671 - name : Setup PHP SDK tool kit
6772 uses : zephir-lang/setup-php-sdk@v1
6873 with :
69- php_version : ${{ inputs.php_version }}
74+ php_version : ${{ inputs.php-version }}
7075 ts : ${{ inputs.ts }}
71- msvc : ${{ inputs.msvc }}
76+ msvc : ${{ inputs.compiler }}
7277 arch : ${{ inputs.arch }}
73- install_dir : ${{ env.TOOLS_DIR }}
74- cache_dir : ${{ env.CACHE_DIR }}
78+ install_dir : ${{ inputs.tools-dir }}
79+ cache_dir : ${{ inputs.cache-dir }}
7580
76- - name : Configure Developer Command Prompt for MSVC compiler
81+ - name : Configure Developer Command Prompt for MSVC
7782 uses : ilammy/msvc-dev-cmd@v1
7883 with :
7984 arch : ${{ inputs.arch }}
8085
81- # Workaround for
82- # PHP Warning: PHP Startup: Can't load module 'C:\tools\php\ext\php_zephir_parser.dll'
83- # as it's linked with 14.29, but the core is linked with 14.16 in Unknown on line 0
84- - name : Configure Developer Command Prompt for MSVC compiler
86+ - name : Configure Developer Command Prompt for MSVC toolset 14.16 (PHP 7.4)
87+ if : inputs.php-version == '7.4'
8588 uses : ilammy/msvc-dev-cmd@v1
86- if : ${{ inputs.php_version }} == '7.4'
8789 with :
8890 arch : ${{ inputs.arch }}
8991 toolset : 14.16
9092
9193 - name : Getting Details About Installed PHP
9294 shell : powershell
93- run : |
94- Get-Php (Get-Command php).Path
95+ run : Get-Php (Get-Command php).Path
9596
9697 - name : Install PECL Package
9798 shell : powershell
9899 run : |
99- .\.github\actions\build-phalcon-win \Expand-Item7zip.ps1 "${{ inputs.pecl }}" "${env:TEMP}"
100- .\.github\actions\build-phalcon-win \Expand-Item7zip.ps1 "${env:TEMP}\phalcon-pecl.tar" "${{ env.PHP_PECL_PATH }}\phalcon"
100+ .\.github\scripts \Expand-Item7zip.ps1 "${{ inputs.pecl }}" "${env:TEMP}"
101+ .\.github\scripts \Expand-Item7zip.ps1 "${env:TEMP}\phalcon-pecl.tar" "${{ env.PHP_PECL_PATH }}\phalcon"
101102
102- - name : Phalcon | phpize
103- working-directory : ' ${{ env.PHP_PECL_PATH }}\phalcon\phalcon-${{ env.PHALCON_VERSION }}'
103+ - name : Phalcon phpize
104+ working-directory : ' ${{ env.PHP_PECL_PATH }}\phalcon\phalcon-${{ inputs.phalcon-version }}'
104105 shell : powershell
105- run : |
106- phpize
106+ run : phpize
107107
108- - name : Phalcon | Configure Project
109- working-directory : ' ${{ env.PHP_PECL_PATH }}\phalcon\phalcon-${{ env.PHALCON_VERSION }}'
108+ - name : Phalcon Configure Project
109+ working-directory : ' ${{ env.PHP_PECL_PATH }}\phalcon\phalcon-${{ inputs.phalcon-version }}'
110110 shell : powershell
111- run : |
112- .\configure.bat --enable-phalcon
111+ run : .\configure.bat --enable-phalcon
113112
114- - name : Phalcon | Build Project
115- working-directory : ' ${{ env.PHP_PECL_PATH }}\phalcon\phalcon-${{ env.PHALCON_VERSION }}'
113+ - name : Phalcon Build Project
114+ working-directory : ' ${{ env.PHP_PECL_PATH }}\phalcon\phalcon-${{ inputs.phalcon-version }}'
116115 shell : powershell
117- run : |
118- nmake
116+ run : nmake
119117
120- - name : Inspecting Phalcon Extension DLL File
118+ - name : Inspect Phalcon Extension DLL
121119 shell : powershell
122- run : |
123- Get-PhpExtension "${{ env.RELEASE_DLL_PATH }}"
120+ run : Get-PhpExtension "${{ env.RELEASE_DLL_PATH }}"
124121
125122 - name : Enable Phalcon Extension
126123 shell : powershell
127124 run : |
128125 Copy-Item -Path "${{ env.RELEASE_DLL_PATH }}" -Destination "${{ env.PHP_ROOT }}\ext\"
129126 Enable-PhpExtension -Extension 'phalcon' -Path "${{ env.PHP_ROOT }}"
130127
131- - name : Check Extension
128+ - name : Check Phalcon Extension
132129 shell : powershell
133130 run : php --ri phalcon
0 commit comments