Skip to content

Commit 3741c19

Browse files
committed
Improve doc recommendations around php-windows-builder action
1 parent 1cef5c8 commit 3741c19

1 file changed

Lines changed: 63 additions & 47 deletions

File tree

docs/extension-maintainers.md

Lines changed: 63 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -485,53 +485,12 @@ Windows-compatible releases is:
485485
- A CI pipeline runs to build the release assets, e.g. in a GitHub Action
486486
- The resulting build assets are published to the GitHub release in a ZIP file
487487

488-
The name of the ZIP file, and the DLL contained within must be:
489-
490-
* `php_{extension-name}-{tag}-{php-maj/min}-{ts|nts}-{compiler}-{arch}.zip`
491-
* Example: `php_xdebug-3.3.2-8.3-ts-vs16-x86_64.zip`
492-
493-
The descriptions of these items:
488+
##### PHP-provided GitHub automation (recommended)
494489

495-
* `extension-name` the name of the extension, e.g. `xdebug`
496-
* `tag` for example `3.3.0alpha3` - defined by the tag/release you have made
497-
* `php-maj/min` - for example `8.3` for PHP 8.3.*
498-
* `compiler` - usually something like `vc6`, `vs16` - fetch from
499-
'PHP Extension Build' flags in `php -i`
500-
* `ts|nts` - Thread-safe or non-thread safe.
501-
* `arch` - for example `x86_64`.
502-
* Windows: use a hint from `Architecture` from `php -i` (see below)
503-
* non-Windows: check `PHP_INT_SIZE` - 4 for 32-bit, 8 for 64-bit.
504-
505-
Note the architecture name will likely need normalising, since different
506-
platforms name architectures differently. PIE expects the following normalised
507-
architectures:
508-
509-
* `x86_64` (normalised from `x64`, `x86_64`, `AMD64`)
510-
* `arm64` (normalised from `arm64`)
511-
* `x86` (any other value)
512-
513-
For the latest map (in case documentation is not up to date), check out
514-
`\Php\Pie\Platform\Architecture::parseArchitecture`.
515-
516-
#### Contents of the Windows ZIP
517-
518-
The pre-built ZIP should contain at minimum a DLL named in the same way as the
519-
ZIP itself, for example
520-
`php_{extension-name}-{tag}-{php-maj/min}-{ts|nts}-{compiler}-{arch}.dll`.
521-
The `.dll` will be moved into the PHP extensions path, and renamed, e.g.
522-
to `C:\path\to\php\ext\php_{extension-name}.dll`. The ZIP file may include
523-
additional resources, such as:
524-
525-
* `php_{extension-name}-{tag}-{php-maj/min}-{ts|nts}-{compiler}-{arch}.pdb` -
526-
this will be moved alongside the `C:\path\to\php\ext\php_{extension-name}.dll`
527-
* `*.dll` - any other `.dll` would be moved alongside `C:\path\to\php\php.exe`
528-
* Any other file, which would be moved
529-
into `C:\path\to\php\extras\{extension-name}\.`
530-
531-
#### Automation of the Windows publishing
532-
533-
PHP provides a [set of GitHub Actions](https://github.com/php/php-windows-builder)
534-
that enable extension maintainers to build and release the Windows compatible
490+
We **highly** recommend using the `php/php-windows-builder` action to automate
491+
this process. PHP provides a
492+
[set of GitHub Actions](https://github.com/php/php-windows-builder) that enable
493+
extension maintainers to easily build and release the Windows compatible
535494
assets. An example workflow that uses these actions:
536495

537496
```yaml
@@ -580,7 +539,64 @@ jobs:
580539
token: ${{ secrets.GITHUB_TOKEN }}
581540
```
582541
583-
Source: [https://github.com/php/php-windows-builder?tab=readme-ov-file#examples](https://github.com/php/php-windows-builder?tab=readme-ov-file#examples)
542+
Check out some more examples and usage here: [https://github.com/php/php-windows-builder?tab=readme-ov-file#examples](https://github.com/php/php-windows-builder?tab=readme-ov-file#examples)
543+
544+
#### Manual definition
545+
546+
> [!WARNING]
547+
> We highly recommend using the `php/php-windows-builder` action provided by
548+
> the PHP group as your automated release process, as mentioned above. If you
549+
> manually define your workflow, you must accept that there may be breakages,
550+
> or flow changes that mean you must maintain your own pipeline.
551+
552+
##### Manual artifact naming scheme
553+
554+
If, for some reason, the `php/php-windows-builder` automation above is not
555+
possible, you can manually build the PIE-compatible packages, but you must
556+
ensure you stick to the conventions defined here.
557+
558+
The name of the ZIP file, and the DLL contained within must be:
559+
560+
* `php_{extension-name}-{tag}-{php-maj/min}-{ts|nts}-{compiler}-{arch}.zip`
561+
* Example: `php_xdebug-3.3.2-8.3-ts-vs16-x86_64.zip`
562+
563+
The descriptions of these items:
564+
565+
* `extension-name` the name of the extension, e.g. `xdebug`
566+
* `tag` for example `3.3.0alpha3` - defined by the tag/release you have made
567+
* `php-maj/min` - for example `8.3` for PHP 8.3.*
568+
* `compiler` - usually something like `vc6`, `vs16` - fetch from
569+
'PHP Extension Build' flags in `php -i`
570+
* `ts|nts` - Thread-safe or non-thread safe.
571+
* `arch` - for example `x86_64`.
572+
* Windows: use a hint from `Architecture` from `php -i` (see below)
573+
* non-Windows: check `PHP_INT_SIZE` - 4 for 32-bit, 8 for 64-bit.
574+
575+
Note the architecture name will likely need normalising, since different
576+
platforms name architectures differently. PIE expects the following normalised
577+
architectures:
578+
579+
* `x86_64` (normalised from `x64`, `x86_64`, `AMD64`)
580+
* `arm64` (normalised from `arm64`)
581+
* `x86` (any other value)
582+
583+
For the latest map (in case documentation is not up to date), check out
584+
`\Php\Pie\Platform\Architecture::parseArchitecture`.
585+
586+
##### Contents of the Windows ZIP
587+
588+
The pre-built ZIP should contain at minimum a DLL named in the same way as the
589+
ZIP itself, for example
590+
`php_{extension-name}-{tag}-{php-maj/min}-{ts|nts}-{compiler}-{arch}.dll`.
591+
The `.dll` will be moved into the PHP extensions path, and renamed, e.g.
592+
to `C:\path\to\php\ext\php_{extension-name}.dll`. The ZIP file may include
593+
additional resources, such as:
594+
595+
* `php_{extension-name}-{tag}-{php-maj/min}-{ts|nts}-{compiler}-{arch}.pdb` -
596+
this will be moved alongside the `C:\path\to\php\ext\php_{extension-name}.dll`
597+
* `*.dll` - any other `.dll` would be moved alongside `C:\path\to\php\php.exe`
598+
* Any other file, which would be moved
599+
into `C:\path\to\php\extras\{extension-name}\.`
584600

585601
## Other features
586602

0 commit comments

Comments
 (0)