-
Notifications
You must be signed in to change notification settings - Fork 40
154 lines (146 loc) · 5.06 KB
/
pecl.yml
File metadata and controls
154 lines (146 loc) · 5.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# Caution: This workflow is internal to the php-windows-builder repository.
# Do not copy this workflow to your repository.
# Instead, refer to the workflows in the examples/ directory.
name: Build PHP Extension From PECL
run-name: Build PHP Extension ${{ inputs.extension-url }}, ${{ inputs.extension-ref }}
on:
workflow_dispatch:
inputs:
extension-url:
description: 'Extension URL'
required: true
extension-ref:
description: 'Extension ref'
required: true
php-version-list:
description: 'PHP versions to build'
required: false
arch-list:
type: choice
options: ['x64', 'x86', 'x64,x86']
description: 'Architectures to build'
required: false
default: 'x64,x86'
ts-list:
type: choice
options: ['nts', 'ts', 'nts,ts']
description: 'Thread safety to build'
required: false
default: 'nts,ts'
args:
description: 'Configure arguments'
required: false
libs:
description: 'Libraries'
required: false
run-tests:
type: choice
options: ['true', 'false']
description: 'Run tests after building the extension'
required: false
default: 'false'
test-runner:
description: 'Test runner to use'
required: false
default: 'run-tests.php'
test-runner-args:
description: 'Arguments for the test runner'
required: false
upload:
type: choice
options: ['true', 'false']
description: Upload artifacts to the downloads server
required: false
default: 'true'
jobs:
get-extension-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.extension-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Get the extension matrix
id: extension-matrix
uses: ./extension-matrix
with:
extension-url: ${{ inputs.extension-url }}
extension-ref: ${{ inputs.extension-ref }}
php-version-list: ${{ inputs.php-version-list }}
arch-list: ${{ inputs.arch-list }}
ts-list: ${{ inputs.ts-list }}
extension:
needs: get-extension-matrix
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix: ${{fromJson(needs.get-extension-matrix.outputs.matrix)}}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Build the extension
uses: ./extension
with:
extension-url: ${{ inputs.extension-url }}
extension-ref: ${{ inputs.extension-ref }}
php-version: ${{ matrix.php-version }}
arch: ${{ matrix.arch }}
ts: ${{ matrix.ts }}
args: ${{ inputs.args }}
libs: ${{ inputs.libs }}
run-tests: ${{ inputs.run-tests }}
test-runner: ${{ inputs.test-runner }}
test-runner-args: ${{ inputs.test-runner-args }}
build-directory: C:\build
env:
artifact-naming-scheme: pecl
auto-detect-args: true
auto-detect-libs: true
no-debug-symbols-ddtrace: true
artifact:
runs-on: ubuntu-latest
needs: extension
outputs:
artifact-id: ${{ steps.artifact.outputs.artifact-id }}
steps:
- name: Upload artifact
uses: actions/upload-artifact/merge@v7
id: merge
with:
name: artifact
delete-merged: true
- name: Get merged artifact
uses: actions/download-artifact@v8
with:
name: artifact
path: artifact
- name: Remove merged artifact
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh api --method DELETE "repos/${{ github.repository }}/actions/artifacts/${{ steps.merge.outputs.artifact-id }}"
- name: Stage artifact for release
id: stage
run: |
extension=$(basename "${{ inputs.extension-url }}" | tr '[:upper:]' '[:lower:]')
mkdir -p /tmp/$extension/$extension/${{ inputs.extension-ref }}/
cp -a artifact/* /tmp/$extension/$extension/${{ inputs.extension-ref }}/
echo "artifact-name=$extension-${{ inputs.extension-ref }}" >> "$GITHUB_OUTPUT"
echo "artifact-path=/tmp/$extension" >> "$GITHUB_OUTPUT"
- name: Upload zip
uses: actions/upload-artifact@v7
id: artifact
with:
name: ${{ steps.stage.outputs.artifact-name }}
path: ${{ steps.stage.outputs.artifact-path }}
upload:
runs-on: ubuntu-latest
needs: artifact
if: ${{ github.event.inputs.upload == 'true' }}
steps:
- name: Upload to downloads server
run: |
extension=$(basename "${{ inputs.extension-url }}")
url="https://api.github.com/repos/${{ github.repository }}/actions/artifacts/${{ needs.artifact.outputs.artifact-id }}/zip"
gh workflow run pecl.yml -R php/web-downloads -f url="$url" -f extension="$extension" -f ref="${{ inputs.extension-ref }}"
env:
GITHUB_TOKEN: ${{ secrets.WINDOWS_BUILDS_TOKEN }}