-
Notifications
You must be signed in to change notification settings - Fork 5
585 lines (513 loc) · 18.4 KB
/
release.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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
# CI wxRuby release workflow
name: Release build
on:
push:
tags:
- v*
paths-ignore:
- '.github/workflows/**'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
release-gem:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
ruby: 'ruby'
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} wxRuby Release (${{ github.ref_name }})
env:
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
CIRRUS_TOKEN: ${{ secrets.CIRRUS_TOKEN }}
outputs:
version: ${{ steps.version_var.outputs.WXRUBY_RELEASE }}
prerelease: ${{ steps.version_var.outputs.WXRUBY_PRERELEASE }}
steps:
- name: Checkout wxRuby3
uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Setup Ruby gems
run: |
bundle install
- name: Build wxRuby3 gem
run: |
bundle exec rake gem
- name: Create GPG signature for wxRuby3 gem
run: |
echo -n "${{ secrets.GPG_KEY }}" | base64 --decode | gpg --pinentry-mode loopback --batch --passphrase ${{ secrets.GPG_PASSPHRASE }} --import
gpg --detach-sign --pinentry-mode loopback --batch --passphrase ${{ secrets.GPG_PASSPHRASE }} --armor pkg/*.gem
- name: Upload gem to release
if: github.event_name != 'workflow_dispatch'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: pkg/*.gem
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Upload gem GPG signature to release
if: github.event_name != 'workflow_dispatch'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: pkg/*.gem.asc
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Publish Gem on RubyGems
if: github.event_name != 'workflow_dispatch'
run: |
gem push pkg/*.gem
- name: Trigger Cirrus CI Release Tasks
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
ruby tools/scripts/cirrus/start_release_tasks.rb "$GITHUB_REF_NAME"
else
ruby tools/scripts/cirrus/start_release_tasks.rb --release "$GITHUB_REF_NAME"
fi
- name: Upload Gem as release test artifact
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v4
with:
name: wxruby3_release_test_gem
path: pkg/*.gem
- name: Set version variables
if: github.event_name != 'workflow_dispatch'
id: version_var
run: |
echo "WXRUBY_RELEASE=${GITHUB_REF_NAME/#v/}" >> "$GITHUB_OUTPUT"
if grep -q "\-[a-zA-Z]" <<< "$GITHUB_REF_NAME" ; then
echo "WXRUBY_PRERELEASE=1" >> "$GITHUB_OUTPUT"
else
echo "WXRUBY_PRERELEASE=0" >> "$GITHUB_OUTPUT"
fi
release-windows-binpkg:
needs: release-gem
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} wxRuby Binpkg Release (${{ github.ref_name }})
env:
DOXYGEN_ROOT: ${{ github.workspace }}\doxygen
strategy:
fail-fast: false
matrix:
include:
- name: Windows2022
os: windows-2022
platform: 'x64'
CXX: g++-12
ruby: 'ruby'
swig: '4'
steps:
- name: Checkout wxRuby3
uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Setup Ruby gems
run: |
bundle install
- name: Cache Doxygen
id: cache-doxygen
uses: actions/cache@v4
with:
path: doxygen-1.10.0.windows.x64.bin.zip
key: ${{ runner.os }}-doxygen
- name: Download Doxygen tool
if: steps.cache-doxygen.outputs.cache-hit != 'true'
run: |
wget.exe https://www.doxygen.nl/files/doxygen-1.10.0.windows.x64.bin.zip
$hash = '2135c1d5bdd6e067b3d0c40a4daac5d63d0fee1b3f4d6ef1e4f092db0d632d5b'
if ((Get-FileHash doxygen-1.10.0.windows.x64.bin.zip -Algorithm SHA256).Hash -ne $hash) {
del doxygen-1.10.0.windows.x64.bin.zip
throw "Doxygen Hash doesn't match!"
}
- name: Install Doxygen package
run: |
Expand-Archive -LiteralPath '.\doxygen-1.10.0.windows.x64.bin.zip' -DestinationPath $env:DOXYGEN_ROOT -Force
echo "$env:DOXYGEN_ROOT" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Display build environment
run: |
echo "$env:PATH"
ruby -v
doxygen -v
ridk exec bash -c 'gcc -v'
ridk exec bash -c 'g++ -v'
- name: Configure wxRuby3
run: |
bundle exec rake configure[--with-wxwin,--autoinstall]
- name: Build wxRuby3
run: |
bundle exec rake build
- name: Build wxRuby3 binpkg
run: |
bundle exec rake binpkg
- name: Upload bin pkg as release asset
if: github.event_name != 'workflow_dispatch'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: pkg/*.pkg
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Upload bin pkg digest signature as release asset
if: github.event_name != 'workflow_dispatch'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: pkg/*.sha
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Upload bin pkg as release test artifacts
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v4
with:
name: wxruby3_release_test_bin_${{ matrix.name }}
path: pkg/*
release-macosx-binpkg:
needs: release-gem
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} wxRuby Binpkg Release (${{ github.ref_name }})
strategy:
fail-fast: false
matrix:
include:
- name: macOS12
os: macos-12
arch: x86_64
ruby: 'ruby'
- name: macOS13
os: macos-13
arch: x86_64
ruby: 'ruby'
steps:
- name: Checkout wxRuby3
uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Setup Ruby gems
run: |
bundle install
- name: Display build environment
run: |
echo "$env:PATH"
ruby -v
- name: Configure wxRuby3
run: |
bundle exec rake configure[--with-wxwin,--autoinstall]
- name: Build wxRuby3
run: |
bundle exec rake build
- name: Build wxRuby3 binpkg
run: |
bundle exec rake binpkg
- name: Upload bin pkg as release asset
if: github.event_name != 'workflow_dispatch'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: pkg/*.pkg
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Upload bin pkg digest signature as release asset
if: github.event_name != 'workflow_dispatch'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: pkg/*.sha
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Upload bin pkg as release test artifacts
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v4
with:
name: wxruby3_release_test_bin_${{ matrix.name }}
path: pkg/*
verify-gem:
needs:
- release-gem
- release-macosx-binpkg
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu2204
os: ubuntu-22.04
gtk_version: 3
CC: gcc-12
CXX: g++-12
ruby: 'ruby'
wxWidgets: '3.2.4'
swig: '4'
configure_flags:
use_xvfb: true
build: true
wxw_type: system
- name: Ubuntu2204
os: ubuntu-22.04
gtk_version: 3
CC: gcc-12
CXX: g++-12
ruby: 'ruby'
wxWidgets: '3.2.4'
swig: '4'
configure_flags:
use_xvfb: true
build: true
wxw_type: embed
- name: macOS12
os: macos-12
arch: x86_64
ruby: 'ruby'
build: false
- name: macOS13
os: macos-13
arch: x86_64
ruby: 'ruby'
build: false
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} wxRuby Gem Test (${{ github.ref_name }})
env:
WXWIDGETS_ROOT: ${{ github.workspace }}/ext/wxWidgets
wxGTK_VERSION: ${{ matrix.gtk_version && matrix.gtk_version || 3 }}
wxCONFIGURE_FLAGS: ${{ matrix.configure_flags }}
wxUSE_ASAN: ${{ matrix.use_asan && 1 || 0 }}
wxUSE_XVFB: ${{ matrix.use_xvfb && 1 || 0 }}
WX_EXTRA_PACKAGES: doxygen patchelf
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
WXRUBY_RELEASE: ${{ needs.release-gem.outputs.version }}
WXRUBY_PRERELEASE: ${{ needs.release-gem.outputs.prerelease }}
steps:
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: checkout wxWidgets
if: ${{ matrix.build && matrix.wxw_type != 'embed' }}
uses: actions/checkout@v4
with:
repository: wxWidgets/wxWidgets
path: ${{ env.WXWIDGETS_ROOT }}
ref: v${{ matrix.wxWidgets }}
submodules: 'recursive'
- name: Prepare package repos
if: ${{ matrix.os == 'ubuntu-22.04' && matrix.wxw_type == 'embed' }}
run: |
sudo apt-get update
- name: Set up build environment
if: ${{ matrix.build && matrix.wxw_type != 'embed' }}
run: |
# Install locales used by our tests to run all the tests instead of
# skipping them.
sudo locale-gen de_DE.utf8 de_CH.utf8 en_US.utf8 fr_FR.utf8 sv_SE.utf8
$WXWIDGETS_ROOT/build/tools/before_install.sh
- name: Display build environment
run: |
echo $PATH
ruby -v
- name: Configuring wxWidgets
if: ${{ matrix.build && matrix.wxw_type != 'embed' }}
working-directory: ${{ env.WXWIDGETS_ROOT }}
run: |
wxCONFIGURE_OPTIONS="$wxCONFIGURE_FLAGS"
if [ -n "${{ matrix.gtk_version }}" ]; then
wxCONFIGURE_OPTIONS="--with-gtk=${{ matrix.gtk_version }} $wxCONFIGURE_OPTIONS"
fi
./configure $wxCONFIGURE_OPTIONS --disable-tests --without-subdirs --disable-debug_info || rc=$?
if [ -n "$rc" ]; then
echo '*** Configuring failed, contents of config.log follows: ***'
echo '-----------------------------------------------------------'
cat $WXWIDGETS_ROOT/config.log
echo '-----------------------------------------------------------'
exit $rc
fi
- name: Build and install wxWidgets
if: ${{ matrix.build && matrix.wxw_type != 'embed' }}
working-directory: ${{ env.WXWIDGETS_ROOT }}
run: |
sudo make install && sudo ldconfig
- name: Install wxRuby3 gem with binary package
if: ${{ !matrix.build && github.event_name != 'workflow_dispatch' }}
run: |
if [ "$WXRUBY_PRERELEASE" == "1" ]; then
gem install wxruby3 -v $WXRUBY_RELEASE --pre -- prebuilt=only
else
gem install wxruby3 -v $WXRUBY_RELEASE -- prebuilt=only
fi
- name: Install wxRuby3 gem for local build
if: ${{ matrix.build && github.event_name != 'workflow_dispatch' }}
run: |
if [ "$WXRUBY_PRERELEASE" == "1" ]; then
gem install wxruby3 -v $WXRUBY_RELEASE --pre -- prebuilt=none
else
gem install wxruby3 -v $WXRUBY_RELEASE -- prebuilt=none
fi
if wxruby check || [ "$?" != "1" ]; then
echo "ERROR: 'wxruby check' returned unexpected result!"
fi
- name: Setup wxRuby3 gem with local build
if: ${{ matrix.build && github.event_name != 'workflow_dispatch' }}
run: |
if [ "${{ matrix.wxw_type }}" == "embed" ]; then
wxruby setup --autoinstall
else
wxruby setup --wxwin=@system --autoinstall
fi
- name: Download release test gem artifact
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: actions/download-artifact@v4
with:
name: wxruby3_release_test_gem
- name: Download bin pkg artifacts
if: ${{ !matrix.build && github.event_name == 'workflow_dispatch' }}
uses: actions/download-artifact@v4
with:
name: wxruby3_release_test_bin_${{ matrix.name }}
- name: Install wxRuby3 gem with binary package (release test)
if: ${{ !matrix.build && github.event_name == 'workflow_dispatch' }}
run: |
gem install ./$(echo wxruby3*.gem) -- package=`pwd`/$(echo wxruby3*.pkg)
- name: Install wxRuby3 gem for local build (release test)
if: ${{ matrix.build && github.event_name == 'workflow_dispatch' }}
run: |
gem install ./$(echo wxruby3*.gem) -- prebuilt=none
if wxruby check || [ "$?" != "1" ]; then
echo "ERROR: 'wxruby check' returned unexpected result!"
fi
- name: Setup wxRuby3 gem with local build (release test)
if: ${{ matrix.build && github.event_name == 'workflow_dispatch' }}
run: |
if [ "${{ matrix.wxw_type }}" == "embed" ]; then
wxruby setup --autoinstall
else
wxruby setup --wxwin=@system --autoinstall
fi
- name: Check wxRuby3 gem install
if: matrix.wxr_type != 'develop'
run: |
wxruby check
- name: Run wxRuby3 regression tests (XVFB)
if: ${{ matrix.use_xvfb }}
run: |
ulimit -c unlimited
TEST_CMD="wxruby test"
/bin/bash -o pipefail -c "xvfb-run -a -s '-screen 0 1600x1200x24' $TEST_CMD 2>&1 | tee -a wxtest.out" || rc=$?
if [ -n "$rc" ]; then
if fgrep -q '(core dumped)' wxtest.out; then
echo '*** Test crashed, trying to get more information ***'
gdb --quiet --core=core -ex 'where' -ex 'thread apply all bt' -ex 'q' --args $TEST_CMD
fi
exit $rc
fi
- name: Run wxRuby3 regression tests
if: ${{ !matrix.use_xvfb }}
run: |
wxruby test
verify-gem-windows:
needs:
- release-gem
- release-windows-binpkg
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} wxRuby Gem Test (${{ github.ref_name }})
env:
WXRUBY_RELEASE: ${{ needs.release-gem.outputs.version }}
WXRUBY_PRERELEASE: ${{ needs.release-gem.outputs.prerelease }}
strategy:
fail-fast: false
matrix:
include:
- name: Windows2022
os: windows-2022
platform: 'x64'
CXX: g++-12
ruby: 'ruby'
swig: '4'
build: false
- name: Windows2022
os: windows-2022
platform: 'x64'
CXX: g++-12
ruby: 'ruby'
swig: '4'
build: true
steps:
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install wxRuby3 gem with binary package
if: ${{ !matrix.build && github.event_name != 'workflow_dispatch' }}
run: |
If ("$env:WXRUBY_PRERELEASE" -eq "1") {
gem install wxruby3 -v $env:WXRUBY_RELEASE --pre -- prebuilt=only
}
Else {
gem install wxruby3 -v $env:WXRUBY_RELEASE -- prebuilt=only
}
- name: Install wxRuby3 gem for local build
if: ${{ matrix.build && github.event_name != 'workflow_dispatch' }}
run: |
If ("$env:WXRUBY_PRERELEASE" -eq "1") {
gem install wxruby3 -v $env:WXRUBY_RELEASE --pre -- prebuilt=none
}
Else {
gem install wxruby3 -v $env:WXRUBY_RELEASE -- prebuilt=none
}
wxruby check
If ($LastExitCode -ne 1) {
echo "ERROR: 'wxruby check' returned unexpected result!"
Exit 1
}
Exit 0
- name: Setup wxRuby3 gem with local build
if: ${{ matrix.build && github.event_name != 'workflow_dispatch' }}
run: |
wxruby setup --autoinstall
- name: Download release test gem artifact
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: actions/download-artifact@v4
with:
name: wxruby3_release_test_gem
- name: Download bin pkg artifacts
if: ${{ !matrix.build && github.event_name == 'workflow_dispatch' }}
uses: actions/download-artifact@v4
with:
name: wxruby3_release_test_bin_${{ matrix.name }}
- name: Install wxRuby3 gem with binary package (release test)
if: ${{ !matrix.build && github.event_name == 'workflow_dispatch' }}
run: |
foreach ($f in Get-ChildItem -Path wxruby3*.gem) { foreach ($p in Get-ChildItem -Path wxruby3*.pkg) { gem install $f -- package=$p } }
- name: Install wxRuby3 gem for local build (release test)
if: ${{ matrix.build && github.event_name == 'workflow_dispatch' }}
run: |
foreach ($f in Get-ChildItem -Path wxruby3*.gem) { gem install $f -- prebuilt=none }
wxruby check
If ($LastExitCode -ne 1) {
echo "ERROR: 'wxruby check' returned unexpected result!"
Exit 1
}
Exit 0
- name: Setup wxRuby3 gem with local build (release test)
if: ${{ matrix.build && github.event_name == 'workflow_dispatch' }}
run: |
foreach ($f in Get-ChildItem -Path wxruby3*.gem) { wxruby setup --autoinstall }
- name: Check wxRuby3 gem install
if: matrix.wxr_type != 'develop'
run: |
wxruby check
- name: Run wxRuby3 regression tests
run: |
wxruby test