Skip to content

Commit ac1ae90

Browse files
committed
Add details of the actions to the README
1 parent 10f7f81 commit ac1ae90

File tree

2 files changed

+127
-1
lines changed

2 files changed

+127
-1
lines changed

LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Permission is hereby granted, free of charge, to any person
2+
obtaining a copy of this software and associated documentation
3+
files (the "Software"), to deal in the Software without
4+
restriction, including without limitation the rights to use,
5+
copy, modify, merge, publish, distribute, sublicense, and/or sell
6+
copies of the Software, and to permit persons to whom the
7+
Software is furnished to do so, subject to the following
8+
conditions:
9+
10+
The above copyright notice and this permission notice shall be
11+
included in all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
15+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+
OTHER DEALINGS IN THE SOFTWARE.

README.md

+107-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,109 @@
11
# php-windows-builder
22

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

Comments
 (0)