|
1 | 1 | # php-windows-builder
|
2 | 2 |
|
3 |
| -Build PHP and PECL extensions on Windows. |
| 3 | +This project provides actions to build PHP and its extensions on Windows. |
| 4 | + |
| 5 | +## Build PHP |
| 6 | + |
| 7 | +Build PHP for a specific version. |
| 8 | + |
| 9 | +```yaml |
| 10 | +- name: Build PHP |
| 11 | + uses: php/php-windows-builder/php@v1 |
| 12 | + with: |
| 13 | + php-version: '7.4.25' |
| 14 | +``` |
| 15 | +
|
| 16 | +### Inputs |
| 17 | +
|
| 18 | +- `php-version` (required) - The PHP version to build. It supports values in major.minor.patch format, e.g. 7.4.25, 8.0.12, etc. |
| 19 | + |
| 20 | +### Outputs |
| 21 | + |
| 22 | +- `artifact-path` - The path to the artifacts produced by the action. |
| 23 | + |
| 24 | +The action will produce the following the following builds for the PHP version as artifacts. |
| 25 | + |
| 26 | +- nts-x64, nts-x64-AVX, ts-x64, nts-x86, ts-x86. |
| 27 | +- debug-pack and devel-pack for each the above configurations. |
| 28 | +- test pack |
| 29 | + |
| 30 | +## Build a PHP extension |
| 31 | + |
| 32 | +Build a PHP extension for a specific version. |
| 33 | + |
| 34 | +```yaml |
| 35 | +- name: Build the extension |
| 36 | + uses: php/php-windows-builder/extension@v1 |
| 37 | + with: |
| 38 | + extension-url: https://github.com/xdebug/xdebug # optional |
| 39 | + extension-version: '3.3.1' |
| 40 | + php-version: '7.4' |
| 41 | + env: |
| 42 | + CONFIGURE_ARGS: --enable-xdebug |
| 43 | +``` |
| 44 | + |
| 45 | +### Inputs |
| 46 | + |
| 47 | +- `extension-url` (optional) - URL of the extension repository, defaults to the current repository. |
| 48 | +- `extension-version` (required) - The version of the extension to build. |
| 49 | +- `php-versions` (optional) - The PHP versions to build the extension for. It supports a comma-separated list of values in major.minor format, e.g. 7.4, 8.0, etc. It defaults to the range defined in the `package.xml`. |
| 50 | + |
| 51 | +### Outputs |
| 52 | + |
| 53 | +- `artifact-path` - The path to the artifacts produced by the action. |
| 54 | + |
| 55 | +The action will produce the following the following builds for the extension as artifacts. |
| 56 | +- nts-x64, ts-x64, nts-x86, ts-x86. |
| 57 | + |
| 58 | +## Release |
| 59 | + |
| 60 | +Upload the artifacts to the release. |
| 61 | + |
| 62 | +```yaml |
| 63 | +- name: Upload artifact to the release |
| 64 | + uses: php/php-windows-builder/release@v1 |
| 65 | + with: |
| 66 | + tag-name: ${{ github.event.release.tag_name }} |
| 67 | + env: |
| 68 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 69 | +``` |
| 70 | + |
| 71 | +### Inputs |
| 72 | + |
| 73 | +- `tag-name` (required) - The tag name of the release. |
| 74 | + |
| 75 | +### Example workflow to build and release an extension |
| 76 | + |
| 77 | +```yaml |
| 78 | +name: Build extension |
| 79 | +on: |
| 80 | + release: |
| 81 | + types: [published] |
| 82 | + # create: # Uncomment this to run on tag/branch creation |
| 83 | + # pull_request: # Uncomment this to run on pull requests |
| 84 | +jobs: |
| 85 | + build: |
| 86 | + runs-on: windows-latest |
| 87 | + steps: |
| 88 | + - name: Checkout |
| 89 | + uses: actions/checkout@v4 |
| 90 | + - name: Build the extension |
| 91 | + uses: php/php-windows-builder/extension@v1 |
| 92 | + with: |
| 93 | + extension-version: ${{ github.event.release.tag_name }} |
| 94 | + release: |
| 95 | + runs-on: ubuntu-latest |
| 96 | + needs: build |
| 97 | + if: ${{ github.event_name == 'release' }} |
| 98 | + steps: |
| 99 | + - name: Upload artifact to the release |
| 100 | + uses: php/php-windows-builder/release@v1 |
| 101 | + with: |
| 102 | + tag-name: ${{ github.event.release.tag_name }} |
| 103 | + env: |
| 104 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 105 | +``` |
| 106 | + |
| 107 | +## License |
| 108 | + |
| 109 | +The scripts and documentation in this project are released under the [MIT License](LICENSE) |
0 commit comments