Skip to content

Commit c85a974

Browse files
committed
init
0 parents  commit c85a974

File tree

3 files changed

+153
-0
lines changed

3 files changed

+153
-0
lines changed

.github/workflows/build.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: 'Build PHP'
2+
on:
3+
push:
4+
pull_request:
5+
repository_dispatch:
6+
schedule:
7+
- cron: '30 23 * * *'
8+
jobs:
9+
build:
10+
runs-on: windows-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
include:
15+
- arch: x64
16+
target: obj-x64
17+
config: nts-windows-vs16-x64
18+
- arch: x64
19+
target: obj-x64
20+
config: ts-windows-vs16-x64
21+
- arch: x64
22+
target: obj-x64
23+
config: nts-windows-vs16-x64-avx
24+
- arch: x86
25+
target: obj
26+
config: nts-windows-vs16-x86
27+
- arch: x86
28+
target: obj
29+
config: ts-windows-vs16-x86
30+
name: Build PHP
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v2
34+
- name: Install PHP
35+
uses: shivammathur/setup-php@develop
36+
with:
37+
php-version: 7.4
38+
ini-values: disable_functions=mail
39+
- name: Test PHP
40+
run: php -v
41+
- name: Test php extensions
42+
run: php -m
43+
- name: Create Build Environment
44+
run: |
45+
New-Item -ItemType "directory" -Path C:\php-snap-build
46+
cd C:\php-snap-build
47+
git clone https://github.com/Microsoft/php-sdk-binary-tools.git php-sdk
48+
git clone https://github.com/php/web-rmtools.git rmtools
49+
New-Item -ItemType "directory" -Path C:\php-snap-build\${{ matrix.target }}
50+
New-Item -ItemType "directory" -Path C:\php-snap-build\snap_master\vs16\${{ matrix.arch }}
51+
Copy-Item -Path C:\php-snap-build\rmtools\bin\rmtools_setvars.bat-dist -Destination C:\php-snap-build\rmtools\bin\rmtools_setvars.bat
52+
Copy-Item -Path C:\php-snap-build\rmtools\data\config\credentials_ftps.php-dist -Destination C:\php-snap-build\rmtools\data\config\credentials_ftps.php
53+
- name: Patch Tools
54+
run: |
55+
$git_location="C:\Program Files\Git\cmd\git.exe"
56+
$tar_location="C:\Program Files\Git\usr\bin\tar.exe"
57+
$task_location="C:\php-snap-build\rmtools\bin\snapshot_task.bat"
58+
$git_script_location="C:\php-snap-build\rmtools\include\Git.php"
59+
$config_location="C:\php-snap-build\rmtools\data\config\branch\${{ matrix.arch }}\phpmaster.ini"
60+
((Get-Content -path $git_script_location -Raw) -replace "c:\\apps\\git\\bin\\git.exe", $git_location) | Set-Content -Path $git_script_location
61+
((Get-Content -path $git_script_location -Raw) -replace "c:\\apps\\git\\bin\\tar.exe", $tar_location) | Set-Content -Path $git_script_location
62+
((Get-Content -path $task_location -Raw) -replace ">> %LOG_FILE% 2<&1", "") | Set-Content -Path $task_location
63+
((Get-Content -path $config_location -Raw) -replace "pgo=1", "pgo=0") | Set-Content -Path $config_location
64+
- name: build PHP
65+
run: |
66+
& C:\php-snap-build\php-sdk\phpsdk-vs16-${{ matrix.arch }}.bat -t C:\php-snap-build\rmtools\bin\snapshot_task.bat --task-args "phpmaster ${{ matrix.config }}"
67+
- name: Collect Artifacts
68+
run: |
69+
mkdir builds
70+
Get-ChildItem C:\php-snap-build\${{ matrix.target }}\* -Recurse -Include php-*.zip | Foreach-Object { Copy-Item -Path $_ -Destination .\builds }
71+
Copy-Item -Path C:\php-snap-build\rmtools\data\db\master.json -Destination .\builds\${{ matrix.config }}.json
72+
Get-ChildItem .\builds *.zip | Rename-Item -NewName { $_.name -replace "win32","windows" }
73+
- name: Upload Artifact
74+
uses: actions/upload-artifact@v2
75+
with:
76+
name: ${{ matrix.config }}
77+
path: builds
78+
upload:
79+
runs-on: ubuntu-latest
80+
needs: build
81+
steps:
82+
- uses: actions/checkout@v2
83+
- run: mkdir builds
84+
- uses: actions/download-artifact@v2
85+
with:
86+
path: builds
87+
- name: Upload to bintray
88+
env:
89+
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
90+
BINTRAY_USER: shivammathur
91+
BINTRAY_REPO: php
92+
GITHUB_REPOSITORY: ${{ github.repository }}
93+
run: |
94+
VERSION=$(curl -sSL https://raw.githubusercontent.com/php/php-src/master/main/php_version.h | grep -Po -m 1 "\d.\d")
95+
curl \
96+
--user "$BINTRAY_USER":"$BINTRAY_KEY" \
97+
--header "Content-Type: application/json" \
98+
--data " \
99+
{\"name\": \"$VERSION-windows\", \
100+
\"vcs_url\": \"$GITHUB_REPOSITORY\", \
101+
\"licenses\": [\"MIT\"], \
102+
\"public_download_numbers\": true, \
103+
\"public_stats\": true \
104+
}" \
105+
https://api.bintray.com/packages/"$BINTRAY_USER"/"$BINTRAY_REPO" || true
106+
mkdir uploads
107+
for file in ./builds/*/*; do
108+
mv $file ./uploads/
109+
done
110+
cd uploads || exit
111+
for file in ./*; do
112+
curl --user "$BINTRAY_USER":"$BINTRAY_KEY" -X DELETE https://api.bintray.com/content/"$BINTRAY_USER"/"$BINTRAY_REPO"/"$file" || true
113+
curl --user "$BINTRAY_USER":"$BINTRAY_KEY" -T "$file" https://api.bintray.com/content/"$BINTRAY_USER"/"$BINTRAY_REPO"/"$VERSION"-windows/$VERSION/"$file" || true
114+
done
115+
curl --user "$BINTRAY_USER":"$BINTRAY_KEY" -X POST https://api.bintray.com/content/"$BINTRAY_USER"/"$BINTRAY_REPO"/"$VERSION"-windows/"$VERSION"/publish || true

LICENSE

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

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# PHP Builder for Windows
2+
3+
<a href="https://github.com/shivammathur/php-builder-windows" title="PHP Builder Windows"><img alt="Build status" src="https://github.com/shivammathur/php-builder-windows/workflows/Build%20PHP/badge.svg"></a>
4+
<a href="https://github.com/shivammathur/php-builder-windows/blob/main/LICENSE" title="license"><img alt="LICENSE" src="https://img.shields.io/badge/license-MIT-428f7e.svg"></a>
5+
<a href="https://github.com/shivammathur/php-builder-windows" title="builds"><img alt="PHP Versions Supported" src="https://img.shields.io/badge/php-%3E%3D%208.0-8892BF.svg"></a>
6+
7+
> Build PHP nightly for windows.
8+
9+
## License
10+
11+
The code in this project is licensed under the [MIT license](http://choosealicense.com/licenses/mit/).
12+
Please see the [license file](LICENSE) for more information. This project has multiple [dependencies](#dependencies "Dependencies for this project"). Their licenses can be found in their respective repositories.
13+
14+
## Dependencies
15+
16+
- [php/web-rmtools](https://github.com/php/web-rmtools)
17+
- [microsoft/php-sdk-binary-tools](https://github.com/microsoft/php-sdk-binary-tools)

0 commit comments

Comments
 (0)