Skip to content

Commit

Permalink
Merge branch 'master' of github.com:php/pecl-encryption-mcrypt
Browse files Browse the repository at this point in the history
* 'master' of github.com:php/pecl-encryption-mcrypt:
  Release 1.0.7 with support for PHP 8.3
  Install libmcrypt dependency
  This should be --with-mcrypt as it uses a library
  Add GHA, to also build Windows binaries
  Fixed package.xml file
  Release 1.0.6 with package support for PHP 8.2
  • Loading branch information
remicollet committed Jul 10, 2024
2 parents d821f9a + 1594986 commit d10010d
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 6 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
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"]
arch: [x86, x64]
ts: [nts, ts]
experimental: [false]
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Extract Version
shell: powershell
run: |
chcp 65001
$r = Select-String -Path php_mcrypt.h -Pattern 'PHP_MCRYPT_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@v0.7
with:
version: ${{matrix.php}}
arch: ${{matrix.arch}}
ts: ${{matrix.ts}}
deps: "libmcrypt"
- 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-mcrypt --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_mcrypt-${{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_mcrypt.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}}
10 changes: 5 additions & 5 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
<email>leigh@php.net</email>
<active>yes</active>
</lead>
<date>2022-04-14</date>
<date>2023-12-12</date>
<version>
<release>1.0.5</release>
<release>1.0.7</release>
<api>1.0.0</api>
</version>
<stability>
Expand All @@ -35,7 +35,7 @@
</stability>
<license uri="http://www.php.net/license">PHP License</license>
<notes>
- Make release to advertise PHP 8 support, which it already had.
- Make release to advertise PHP 8.3 support, which it already had.
</notes>
<contents>
<dir name="/">
Expand Down Expand Up @@ -106,8 +106,8 @@
<required>
<php>
<min>7.2.0</min>
<max>8.2.0</max>
<exclude>8.2.0</exclude>
<max>8.4.0</max>
<exclude>8.4.0</exclude>
</php>
<pearinstaller>
<min>1.4.0</min>
Expand Down
2 changes: 1 addition & 1 deletion php_mcrypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
extern zend_module_entry mcrypt_module_entry;
#define mcrypt_module_ptr &mcrypt_module_entry

#define PHP_MCRYPT_VERSION "1.0.5"
#define PHP_MCRYPT_VERSION "1.0.7"

/* Functions for both old and new API */
PHP_FUNCTION(mcrypt_ecb);
Expand Down

0 comments on commit d10010d

Please sign in to comment.