-
-
Notifications
You must be signed in to change notification settings - Fork 6
257 lines (236 loc) · 8.49 KB
/
win32.yml
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
name: build on windows
on:
pull_request:
paths:
- "versions/win32.json"
- "scripts/windows/**"
- "scripts/lib/Devel/**"
- ".github/workflows/win32.yml"
- ".github/build-openssl-win32.sh"
push:
branches:
- "releases/*"
schedule:
- cron: "29 0 * * 2"
workflow_dispatch:
inputs:
perl-versions:
description: perl versions to build (JSON Array)
required: false
default: ""
jobs:
list:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: set-matrix
name: list available perl versions
run: |
if [ -n "$PERL_VERSIONS" ]; then
echo "matrix=$(printenv PERL_VERSIONS | jq -c '{perl: .}')" >> "$GITHUB_OUTPUT"
else
echo "matrix=$(<versions/win32.json jq -c '{perl: .}')" >> "$GITHUB_OUTPUT"
fi
env:
PERL_VERSIONS: ${{ github.event.inputs.perl-versions }}
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
sanity-check:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- id: perl
name: setup host perl
shell: bash
run: |
cat << 'END_OF_PATH' >> "$GITHUB_PATH"
C:\strawberry\c\bin
C:\strawberry\perl\site\bin
C:\strawberry\perl\bin
END_OF_PATH
perl -e 'print "version=$^V\n"' >> "$GITHUB_OUTPUT"
- uses: actions/cache@v4
with:
path: scripts/windows/local
key: Windows-sanity-check-perl-${{ steps.perl.outputs.version }}-${{ hashFiles('scripts/windows/cpanfile.snapshot') }}
restore-keys: Windows-sanity-check-perl-${{ steps.perl.outputs.version }}-
- name: sanity check
run: |
../../bin/carton install --deployment
../../bin/carton exec perl -c build.pl
../../bin/carton exec perl -I../lib -c ../lib/Devel/PatchPerl/Plugin/GitHubActions.pm
../../bin/carton exec perl -I../lib -c ../lib/Devel/PatchPerl/Plugin/MinGW.pm
../../bin/carton exec perl -I../lib -c ../lib/Devel/PatchPerl/Plugin/MinGWGNUmakefile.pm
working-directory: ./scripts/windows
shell: cmd
build:
runs-on: windows-2022
needs:
- list
- sanity-check
timeout-minutes: 120
strategy:
fail-fast: false
matrix: ${{fromJson(needs.list.outputs.matrix)}}
env:
PERL_VERSION: ${{ matrix.perl }}
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
install: make mingw-w64-x86_64-gcc nasm
- name: install OpenSSL
run: .github/build-openssl-win32.sh
shell: "msys2 {0}"
- id: perl
name: setup host perl
shell: bash
run: |
cat << 'END_OF_PATH' >> "$GITHUB_PATH"
C:\strawberry\c\bin
C:\strawberry\perl\site\bin
C:\strawberry\perl\bin
END_OF_PATH
perl -e 'print "version=$^V\n"' >> "$GITHUB_OUTPUT"
- name: Host perl -V
run: perl -V
- name: gcc --version
run: gcc --version
# https://support.microsoft.com/en-us/help/254649/overview-of-memory-dump-file-options-for-windows
# https://docs.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps
- name: "enable Windows Error Reporting, WER"
run: |
mkdir "${{ runner.temp }}/perl-wer"
reg add HKLM\SOFTWARE\Microsoft\Windows"\Windows Error Reporting"\LocalDumps /v DumpType /t REG_DWORD /d 2
reg add HKLM\SOFTWARE\Microsoft\Windows"\Windows Error Reporting"\LocalDumps /v DumpFolder /t REG_EXPAND_SZ /d "${{ runner.temp }}/perl-wer"
shell: cmd
- uses: actions/cache@v4
with:
path: scripts/windows/local
key: ${{ runner.os }}-build-perl-${{ steps.perl.outputs.version }}-${{ hashFiles('scripts/windows/cpanfile.snapshot') }}
restore-keys: ${{ runner.os }}-build-perl-${{ steps.perl.outputs.version }}-
- name: carton install
shell: cmd
run: ../../bin/carton install
working-directory: ./scripts/windows
- name: build
shell: cmd
run: perl build.pl
env:
PERL5LIB: ${{ github.workspace }}/scripts/windows/local/lib/perl5
# PERL_DL_DEBUG: "10" # enables debugging
working-directory: ./scripts/windows
# for debugging
# - uses: actions/upload-artifact@v4
# with:
# name: perl-${{ matrix.perl }}
# path: ${{ runner.temp }}/perl-${{ matrix.perl }}
# if: failure()
- uses: actions/upload-artifact@v4
with:
name: perl-${{ matrix.perl }}-wer
path: ${{ runner.temp }}/perl-wer
if: failure()
- uses: actions/setup-python@v5
with:
python-version: "3.x"
if: failure()
- run: |
pip install minidump
minidump --all ./*.dmp
if: failure()
shell: bash
working-directory: ${{ runner.temp }}/perl-wer
- name: upload
shell: bash
run: |
ACTIONS_VERSION=v$(< "$GITHUB_WORKSPACE/package.json" jq -r .version)
TEMP_DIR=$(cygpath "$RUNNER_TEMP")
mv "$TEMP_DIR/perl.zip" "$TEMP_DIR/perl-$PERL_VERSION-win32-x64.zip"
gh release upload --clobber "$ACTIONS_VERSION" "$TEMP_DIR/perl-$PERL_VERSION-win32-x64.zip"
env:
PERL_VERSION: ${{ matrix.perl }}
GITHUB_TOKEN: ${{ github.token }}
build-multi-thread:
runs-on: windows-2022
needs:
- sanity-check
- list
timeout-minutes: 120
strategy:
fail-fast: false
matrix: ${{fromJson(needs.list.outputs.matrix)}}
env:
PERL_VERSION: ${{ matrix.perl }}
PERL_MULTI_THREAD: "1"
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
install: make mingw-w64-x86_64-gcc nasm
- name: install OpenSSL
run: .github/build-openssl-win32.sh
shell: "msys2 {0}"
- id: perl
name: setup host perl
shell: bash
run: |
cat << 'END_OF_PATH' >> "$GITHUB_PATH"
C:\strawberry\c\bin
C:\strawberry\perl\site\bin
C:\strawberry\perl\bin
END_OF_PATH
perl -e 'print "version=$^V\n"' >> "$GITHUB_OUTPUT"
- name: Host perl -V
run: perl -V
- name: gcc --version
run: gcc --version
# https://support.microsoft.com/en-us/help/254649/overview-of-memory-dump-file-options-for-windows
# https://docs.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps
- name: "enable Windows Error Reporting, WER"
run: |
mkdir "${{ runner.temp }}/perl-wer"
reg add HKLM\SOFTWARE\Microsoft\Windows"\Windows Error Reporting"\LocalDumps /v DumpType /t REG_DWORD /d 2
reg add HKLM\SOFTWARE\Microsoft\Windows"\Windows Error Reporting"\LocalDumps /v DumpFolder /t REG_EXPAND_SZ /d "${{ runner.temp }}/perl-wer"
shell: cmd
- uses: actions/cache@v4
with:
path: scripts/windows/local
key: ${{ runner.os }}-build-perl-${{ steps.perl.outputs.version }}-${{ hashFiles('scripts/windows/cpanfile.snapshot') }}
restore-keys: ${{ runner.os }}-build-perl-${{ steps.perl.outputs.version }}-
- name: carton install
shell: cmd
run: ../../bin/carton install
working-directory: ./scripts/windows
- name: build
shell: cmd
run: perl build.pl
env:
PERL5LIB: ${{ github.workspace }}/scripts/windows/local/lib/perl5
# PERL_DL_DEBUG: "10" # enables debugging
working-directory: ./scripts/windows
- uses: actions/upload-artifact@v4
with:
name: perl-${{ matrix.perl }}-wer
path: ${{ runner.temp }}/perl-wer
if: failure()
- uses: actions/setup-python@v5
with:
python-version: "3.x"
if: failure()
- run: |
pip install minidump
minidump --all ./*.dmp
if: failure()
shell: bash
working-directory: ${{ runner.temp }}/perl-wer
- name: upload
shell: bash
run: |
ACTIONS_VERSION=v$(< "$GITHUB_WORKSPACE/package.json" jq -r .version)
TEMP_DIR=$(cygpath "$RUNNER_TEMP")
mv "$TEMP_DIR/perl.zip" "$TEMP_DIR/perl-$PERL_VERSION-win32-x64-multi-thread.zip"
gh release upload --clobber "$ACTIONS_VERSION" "$TEMP_DIR/perl-$PERL_VERSION-win32-x64-multi-thread.zip"
env:
PERL_VERSION: ${{ matrix.perl }}
GITHUB_TOKEN: ${{ github.token }}