-
Notifications
You must be signed in to change notification settings - Fork 2
739 lines (681 loc) · 22.8 KB
/
build.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
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
name: 'Build: Ubuntu 20.04'
on:
push:
branches:
- master
workflow_dispatch:
env:
GH_API_ROOT: https://api.github.com/repos/p5-net-ssleay/ci-libssl
GH_UPLOAD_ROOT: https://uploads.github.com/repos/p5-net-ssleay/ci-libssl
jobs:
libressl:
name: LibreSSL ${{ matrix.version }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
version:
# LibreSSL 2.0
- '2.0.5'
- '2.0.6'
# LibreSSL 2.1
- '2.1.5'
- '2.1.6'
- '2.1.7'
- '2.1.8'
- '2.1.9'
- '2.1.10'
# LibreSSL 2.2
- '2.2.2'
- '2.2.3'
- '2.2.4'
- '2.2.5'
- '2.2.6'
- '2.2.7'
- '2.2.8'
- '2.2.9'
# LibreSSL 2.3
- '2.3.3'
- '2.3.4'
- '2.3.5'
- '2.3.6'
- '2.3.7'
- '2.3.8'
- '2.3.9'
- '2.3.10'
# LibreSSL 2.4
- '2.4.2'
- '2.4.3'
- '2.4.4'
- '2.4.5'
# LibreSSL 2.5
- '2.5.3'
- '2.5.4'
- '2.5.5'
# LibreSSL 2.6
- '2.6.3'
- '2.6.4'
- '2.6.5'
# LibreSSL 2.7
- '2.7.2'
- '2.7.3'
- '2.7.4'
- '2.7.5'
# LibreSSL 2.8
- '2.8.2'
- '2.8.3'
# LibreSSL 2.9
- '2.9.2'
# LibreSSL 3.0
- '3.0.2'
# LibreSSL 3.1
- '3.1.1'
- '3.1.2'
- '3.1.3'
- '3.1.4'
- '3.1.5'
# LibreSSL 3.2
- '3.2.2'
- '3.2.3'
- '3.2.4'
- '3.2.5'
- '3.2.6'
- '3.2.7'
# LibreSSL 3.3
- '3.3.3'
- '3.3.4'
- '3.3.5'
- '3.3.6'
# LibreSSL 3.4
- '3.4.1'
- '3.4.2'
- '3.4.3'
# LibreSSL 3.5
- '3.5.2'
- '3.5.3'
- '3.5.4'
# LibreSSL 3.6
- '3.6.1'
- '3.6.2'
- '3.6.3'
# LibreSSL 3.7
- '3.7.2'
- '3.7.3'
# LibreSSL 3.8
- '3.8.2'
steps:
- name: Check out ci-libssl repository
uses: actions/checkout@v3
- name: Restore cached LibreSSL source tarball
uses: actions/cache@v3
with:
path: libressl-${{ matrix.version }}.tar.gz
key: libressl-${{ matrix.version }}
- name: Download LibreSSL source tarball
run: |
if [ ! -f libressl-${{ matrix.version }}.tar.gz ]; then
curl \
--fail \
-o libressl-${{ matrix.version }}.tar.gz \
https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${{ matrix.version }}.tar.gz
fi
- name: Extract LibreSSL source tarball
run: |
tar xf libressl-${{ matrix.version }}.tar.gz
- name: Configure LibreSSL
working-directory: libressl-${{ matrix.version }}
run: |
config_opts=""
# Engine support was removed in LibreSSL 2.2.2
if echo ${{ matrix.version }} | grep -q '^2\.\([01]\|2\.[01]\)'; then
config_opts="$config_opts --with-enginesdir=$HOME/libssl/lib/engines"
fi
# Don't install man pages
sed -i -e '/^ac_config_files=/s#man/Makefile##' configure
sed -i -e '/^SUBDIRS = /s/man//' Makefile.am
sed -i -e '/^SUBDIRS = /s/man//' Makefile.in
sed -i -e '/^DIST_SUBDIRS = /s/man//' Makefile.in
rm -f man/Makefile.*
if [ -f apps/openssl/Makefile.am ]; then
sed -i -e '/dist_man_MANS = /s/openssl\.1//' apps/openssl/Makefile.am
sed -i -e '/dist_man_MANS = /s/openssl\.1//' apps/openssl/Makefile.in
fi
# Don't build libtls
sed -i -e '/^ac_config_files=/s#tls/Makefile##' configure
sed -i -e '/^SUBDIRS = /s/tls//' Makefile.am
sed -i -e '/^SUBDIRS = /s/tls//' Makefile.in
rm -f tls/Makefile
sed -i -e '/^ac_config_files=/s#libtls\.pc##' configure
sed -i -e '/^pkgconfig_DATA = /s/libtls\.pc//' Makefile.am
sed -i -e '/^pkgconfig_DATA = /s/libtls\.pc//' Makefile.in
sed -i -e '/^include_HEADERS = /s/tls\.h//' include/Makefile.am
sed -i -e '/^include_HEADERS = /s/tls\.h//' include/Makefile.in
# Don't build the nc or ocspcheck apps (they use libtls)
if [ -d apps/nc ]; then
sed -i -e '/^ac_config_files=/s#apps/nc/Makefile##' configure
sed -i -e '/^SUBDIRS = /s/nc//' apps/Makefile.am
sed -i -e '/^SUBDIRS = /s/nc//' apps/Makefile.in
rm -f apps/nc/Makefile.*
fi
if [ -d apps/ocspcheck ]; then
sed -i -e '/^ac_config_files=/s#apps/ocspcheck/Makefile##' configure
sed -i -e '/^SUBDIRS = /s/ocspcheck//' apps/Makefile.am
sed -i -e '/^SUBDIRS = /s/ocspcheck//' apps/Makefile.in
rm -f apps/nc/Makefile.*
fi
# Don't build tests (some of them rely on libtls)
if echo ${{ matrix.version }} | grep -q '^\(2\|3\.0\)'; then
sed -i -e '/^ac_config_files=/s#tests/Makefile##' configure
sed -i -e '/^SUBDIRS = /s/tests//' Makefile.am
sed -i -e '/^SUBDIRS = /s/tests//' Makefile.in
rm -f tests/Makefile.*
else
config_opts="$config_opts --disable-tests"
fi
CFLAGS="-fPIC" \
./configure \
--prefix=$HOME/libssl \
--enable-shared \
--disable-static \
--with-openssldir=$HOME/libssl \
$config_opts
- name: Build LibreSSL
working-directory: libressl-${{ matrix.version }}
run: |
make
- name: Install LibreSSL
working-directory: libressl-${{ matrix.version }}
run: |
make install
# The default configuration file isn't installed by "make install" in
# LibreSSL 2.1 and below, and LibreSSL 2.0 doesn't ship a default
# configuration at all
if [ ! -f $HOME/libssl/openssl.cnf ]; then
if [ -f apps/openssl.cnf ]; then
install -m0644 apps/openssl.cnf $HOME/libssl/openssl.cnf
else
cat > $HOME/libssl/openssl.cnf << ' EOF'
[ req ]
distinguished_name = req_distinguished_name
attributes = req_attributes
[ req_distinguished_name ]
countryName = Country Name (2 letter code)
countryName_min = 2
countryName_max = 2
stateOrProvinceName = State or Province Name (full name)
localityName = Locality Name (eg, city)
0.organizationName = Organization Name (eg, company)
organizationalUnitName = Organizational Unit Name (eg, section)
commonName = Common Name (eg, fully qualified host name)
commonName_max = 64
emailAddress = Email Address
emailAddress_max = 64
[ req_attributes ]
challengePassword = A challenge password
challengePassword_min = 4
challengePassword_max = 20
EOF
fi
fi
- name: Minify LibreSSL installation
run: |
ls -aslR $HOME/libssl
du -sh $HOME/libssl
echo ================================
cd $HOME/libssl
# We don't need the static libraries
rm -f $HOME/libssl/lib/*.a
# We don't need the libtool files
rm -f $HOME/libssl/lib/*.la
cd
ls -aslR $HOME/libssl
du -sh $HOME/libssl
- name: Create LibreSSL binary tarball
id: tarball
run: |
cd $HOME
tar \
--sort=name \
--owner=root:0 \
--group=root:0 \
--mtime='UTC 2020-01-01' \
-cJf libressl-${{ matrix.version }}.tar.xz \
libssl
- name: Obtain GitHub App installation access token
id: gh_app
run: |
token="$(npx obtain-github-app-installation-access-token ci ${{ secrets.GH_APP_CREDENTIALS_TOKEN }})"
echo "::add-mask::$token"
echo "token=$token" >> $GITHUB_OUTPUT
- name: Create GitHub release for LibreSSL ${{ matrix.version }}
id: release
run: |
release="$( \
curl \
--fail \
-H "Authorization: Bearer ${{ steps.gh_app.outputs.token }}" \
-H "Accept: application/vnd.github.v3+json" \
$GH_API_ROOT/releases/tags/libressl-${{ matrix.version }} \
|| \
curl \
--fail \
-H "Authorization: Bearer ${{ steps.gh_app.outputs.token }}" \
-H "Accept: application/vnd.github.v3+json" \
-X POST \
-d '{
"tag_name": "libressl-${{ matrix.version }}",
"target_commitish": "${{ github.sha }}",
"name": "LibreSSL ${{ matrix.version }}",
"draft": false,
"prerelease": false
}' \
$GH_API_ROOT/releases \
)"
release_id="$(echo "$release" | jq -r .id)"
target_commit="$(echo "$release" | jq -r .target_commitish)"
asset_id="$(echo "$release" | jq -r '[ .assets[] | select(.name == "libressl-${{ matrix.version }}-ubuntu-20.04.tar.xz") ] | first.id')"
echo "release_id=$release_id" >> $GITHUB_OUTPUT
echo "target_commit=$target_commit" >> $GITHUB_OUTPUT
echo "asset_id=$asset_id" >> $GITHUB_OUTPUT
- name: Update commit hash for libressl-${{ matrix.version }} tag
run: |
curl \
--fail \
-H "Authorization: Bearer ${{ steps.gh_app.outputs.token }}" \
-H "Accept: application/vnd.github.v3+json" \
-X PATCH \
-d '{
"sha": "${{ github.sha }}",
"force": true
}' \
$GH_API_ROOT/git/refs/tags/libressl-${{ matrix.version }}
if: ${{ github.sha != steps.release.outputs.target_commit }}
- name: Update target commit hash for GitHub release
run: |
curl \
--fail \
-H "Authorization: Bearer ${{ steps.gh_app.outputs.token }}" \
-H "Accept: application/vnd.github.v3+json" \
-X PATCH \
-d '{
"target_commitish": "${{ github.sha }}"
}' \
$GH_API_ROOT/releases/${{ steps.release.outputs.release_id }}
if: ${{ github.sha != steps.release.outputs.target_commit }}
- name: Upload GitHub release asset
run: |
if [ "${{ steps.release.outputs.asset_id }}" != "null" ]; then
curl \
--fail \
-H "Authorization: Bearer ${{ steps.gh_app.outputs.token }}" \
-H "Accept: application/vnd.github.v3+json" \
-X DELETE \
$GH_API_ROOT/releases/assets/${{ steps.release.outputs.asset_id }}
fi
curl \
--fail \
-H "Authorization: Bearer ${{ steps.gh_app.outputs.token }}" \
-H "Accept: application/vnd.github.v3+json" \
-H "Content-Type: application/x-xz" \
-X POST \
--data-binary "@$HOME/libressl-${{ matrix.version }}.tar.xz" \
$GH_UPLOAD_ROOT/releases/${{ steps.release.outputs.release_id }}/assets?name=libressl-${{ matrix.version }}-ubuntu-20.04.tar.xz
openssl:
name: OpenSSL ${{ matrix.version }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
version:
# OpenSSL 0.9.8
- '0.9.8'
- '0.9.8a'
- '0.9.8b'
- '0.9.8c'
- '0.9.8d'
- '0.9.8e'
- '0.9.8f'
- '0.9.8g'
- '0.9.8h'
- '0.9.8i'
- '0.9.8j'
- '0.9.8k'
- '0.9.8l'
- '0.9.8m'
- '0.9.8n'
- '0.9.8o'
- '0.9.8p'
- '0.9.8q'
- '0.9.8r'
- '0.9.8s'
- '0.9.8t'
- '0.9.8u'
- '0.9.8v'
- '0.9.8w'
- '0.9.8x'
- '0.9.8y'
- '0.9.8za'
- '0.9.8zb'
- '0.9.8zc'
- '0.9.8zd'
- '0.9.8ze'
- '0.9.8zf'
- '0.9.8zg'
- '0.9.8zh'
# OpenSSL 1.0.0
- '1.0.0'
- '1.0.0a'
- '1.0.0b'
- '1.0.0c'
- '1.0.0d'
- '1.0.0e'
- '1.0.0f'
- '1.0.0g'
- '1.0.0h'
- '1.0.0i'
- '1.0.0j'
- '1.0.0k'
- '1.0.0l'
- '1.0.0m'
- '1.0.0n'
- '1.0.0o'
- '1.0.0p'
- '1.0.0q'
- '1.0.0r'
- '1.0.0s'
- '1.0.0t'
# OpenSSL 1.0.1
- '1.0.1'
- '1.0.1a'
- '1.0.1b'
- '1.0.1c'
- '1.0.1d'
- '1.0.1e'
- '1.0.1f'
- '1.0.1g'
- '1.0.1h'
- '1.0.1i'
- '1.0.1j'
- '1.0.1k'
- '1.0.1l'
- '1.0.1m'
- '1.0.1n'
- '1.0.1o'
- '1.0.1p'
- '1.0.1q'
- '1.0.1r'
- '1.0.1s'
- '1.0.1t'
- '1.0.1u'
# OpenSSL 1.0.2
- '1.0.2'
- '1.0.2a'
- '1.0.2b'
- '1.0.2c'
- '1.0.2d'
- '1.0.2e'
- '1.0.2f'
- '1.0.2g'
- '1.0.2h'
- '1.0.2i'
- '1.0.2j'
- '1.0.2k'
- '1.0.2l'
- '1.0.2m'
- '1.0.2n'
- '1.0.2o'
- '1.0.2p'
- '1.0.2q'
- '1.0.2r'
- '1.0.2s'
- '1.0.2t'
- '1.0.2u'
# OpenSSL 1.1.0
- '1.1.0'
- '1.1.0a'
- '1.1.0b'
- '1.1.0c'
- '1.1.0d'
- '1.1.0e'
- '1.1.0f'
- '1.1.0g'
- '1.1.0h'
- '1.1.0i'
- '1.1.0j'
- '1.1.0k'
- '1.1.0l'
# OpenSSL 1.1.1
- '1.1.1'
- '1.1.1a'
- '1.1.1b'
- '1.1.1c'
- '1.1.1d'
- '1.1.1e'
- '1.1.1f'
- '1.1.1g'
- '1.1.1h'
- '1.1.1i'
- '1.1.1j'
- '1.1.1k'
- '1.1.1l'
- '1.1.1m'
- '1.1.1n'
- '1.1.1o'
- '1.1.1p'
- '1.1.1q'
# 1.1.1r was withdrawn
- '1.1.1s'
- '1.1.1t'
- '1.1.1u'
- '1.1.1v'
- '1.1.1w'
# OpenSSL 3.0
- '3.0.0'
- '3.0.1'
- '3.0.2'
- '3.0.3'
- '3.0.4'
- '3.0.5'
# 3.0.6 was withdrawn
- '3.0.7'
- '3.0.8'
- '3.0.9'
- '3.0.10'
- '3.0.11'
- '3.0.12'
# OpenSSL 3.1
- '3.1.0'
- '3.1.1'
- '3.1.2'
- '3.1.3'
- '3.1.4'
# OpenSSL 3.2
- '3.2.0'
steps:
- name: Check out ci-libssl repository
uses: actions/checkout@v3
- name: Restore cached OpenSSL source tarball
uses: actions/cache@v3
with:
path: openssl-${{ matrix.version }}.tar.gz
key: openssl-${{ matrix.version }}
- name: Download OpenSSL source tarball
run: |
if [ ! -f openssl-${{ matrix.version }}.tar.gz ]; then
case "${{ matrix.version }}" in
0.9.8*)
src_path="source/old/0.9.x"
;;
1.1.1*|3.*)
src_path="source"
;;
*)
src_path="source/old/$(echo ${{ matrix.version }} | sed -e 's/[a-z]*$//')"
;;
esac
curl \
--fail \
-o openssl-${{ matrix.version }}.tar.gz \
https://www.openssl.org/$src_path/openssl-${{ matrix.version }}.tar.gz
fi
- name: Extract OpenSSL source tarball
run: |
tar xf openssl-${{ matrix.version }}.tar.gz
- name: Configure OpenSSL
working-directory: openssl-${{ matrix.version }}
run: |
config_opts=""
# OpenSSL 1.0.0 and above install libraries to PREFIX/lib64 on x86_64
# by default - install them to PREFIX/lib for consistency with OpenSSL
# 0.9.8
if echo ${{ matrix.version }} | grep -qv '^0'; then
config_opts="$config_opts --libdir=lib"
fi
# ASM has all kinds of problems on x86_64 in OpenSSL 0.9.8 and 1.0.0
if echo ${{ matrix.version }} | grep -q '^\(0\.9\.8\|1\.0\.0\)'; then
config_opts="$config_opts no-asm"
sed -i -e 's/^\(my \$no_asm\)=0;/\1=1;/' Configure
fi
# 1.1.0c and above don't add RPATH to OpenSSL binary when non-standard
# prefix is in use (https://github.com/openssl/openssl/issues/1740) -
# add it explicitly
if echo ${{ matrix.version }} | grep -q '^\(1\.1\.0[c-l]\|1\.1\.1\|3\)'; then
config_opts="$config_opts -Wl,--enable-new-dtags,-rpath,\$(LIBRPATH)"
fi
# glob() has been replaced with bsd_glob() in File::Glob
if echo ${{ matrix.version }} | grep -q '^1\.1'; then
for i in Configure test/build.info util/process_docs.pl; do
sed -i -e "s#'File::Glob' => qw/glob/#'File::Glob' => qw/bsd_glob/#g" $i
done
fi
./config \
--prefix=$HOME/libssl \
--openssldir=$HOME/libssl \
-Wa,--noexecstack \
-fPIC \
enable-shared \
$config_opts
- name: Build OpenSSL
working-directory: openssl-${{ matrix.version }}
run: |
make depend || true
make
- name: Install OpenSSL
working-directory: openssl-${{ matrix.version }}
run: |
make install_sw
make install_ssldirs || true
- name: Minify OpenSSL installation
run: |
ls -aslR $HOME/libssl
du -sh $HOME/libssl
echo ================================
cd $HOME/libssl
# Don't keep unnecessary engines
for i in 4758cca aep atalla capi chil cswift gmp gost loader_attic nuron padlock sureware ubsec; do
if echo ${{ matrix.version }} | grep -q '^3\.'; then
rm -f $HOME/libssl/lib/engines-3/$i.so
elif echo ${{ matrix.version }} | grep -q '^1\.1'; then
rm -f $HOME/libssl/lib/engines-1.1/$i.so
else
rm -f $HOME/libssl/lib/engines/lib$i.so
fi
done
# These utilities aren't necessary for testing Net-SSLeay
rm -f $HOME/libssl/bin/c_rehash
rm -rf $HOME/libssl/misc
# We don't need the static libraries
rm -f $HOME/libssl/lib/*.a
cd
ls -aslR $HOME/libssl
du -sh $HOME/libssl
- name: Create OpenSSL binary tarball
id: tarball
run: |
cd $HOME
tar \
--sort=name \
--owner=root:0 \
--group=root:0 \
--mtime='UTC 2020-01-01' \
-cJf openssl-${{ matrix.version }}.tar.xz \
libssl
- name: Obtain GitHub App installation access token
id: gh_app
run: |
token="$(npx obtain-github-app-installation-access-token ci ${{ secrets.GH_APP_CREDENTIALS_TOKEN }})"
echo "::add-mask::$token"
echo "token=$token" >> $GITHUB_OUTPUT
- name: Create GitHub release for OpenSSL ${{ matrix.version }}
id: release
run: |
release="$( \
curl \
--fail \
-H "Authorization: Bearer ${{ steps.gh_app.outputs.token }}" \
-H "Accept: application/vnd.github.v3+json" \
$GH_API_ROOT/releases/tags/openssl-${{ matrix.version }} \
|| \
curl \
--fail \
-H "Authorization: Bearer ${{ steps.gh_app.outputs.token }}" \
-H "Accept: application/vnd.github.v3+json" \
-X POST \
-d '{
"tag_name": "openssl-${{ matrix.version }}",
"target_commitish": "${{ github.sha }}",
"name": "OpenSSL ${{ matrix.version }}",
"draft": false,
"prerelease": false
}' \
$GH_API_ROOT/releases \
)"
release_id="$(echo "$release" | jq -r .id)"
target_commit="$(echo "$release" | jq -r .target_commitish)"
asset_id="$(echo "$release" | jq -r '[ .assets[] | select(.name == "openssl-${{ matrix.version }}-ubuntu-20.04.tar.xz") ] | first.id')"
echo "release_id=$release_id" >> $GITHUB_OUTPUT
echo "target_commit=$target_commit" >> $GITHUB_OUTPUT
echo "asset_id=$asset_id" >> $GITHUB_OUTPUT
- name: Update commit hash for openssl-${{ matrix.version }} tag
run: |
curl \
--fail \
-H "Authorization: Bearer ${{ steps.gh_app.outputs.token }}" \
-H "Accept: application/vnd.github.v3+json" \
-X PATCH \
-d '{
"sha": "${{ github.sha }}",
"force": true
}' \
$GH_API_ROOT/git/refs/tags/openssl-${{ matrix.version }}
if: ${{ github.sha != steps.release.outputs.target_commit }}
- name: Update target commit hash for GitHub release
run: |
curl \
--fail \
-H "Authorization: Bearer ${{ steps.gh_app.outputs.token }}" \
-H "Accept: application/vnd.github.v3+json" \
-X PATCH \
-d '{
"target_commitish": "${{ github.sha }}"
}' \
$GH_API_ROOT/releases/${{ steps.release.outputs.release_id }}
if: ${{ github.sha != steps.release.outputs.target_commit }}
- name: Upload GitHub release asset
run: |
if [ "${{ steps.release.outputs.asset_id }}" != "null" ]; then
curl \
--fail \
-H "Authorization: Bearer ${{ steps.gh_app.outputs.token }}" \
-H "Accept: application/vnd.github.v3+json" \
-X DELETE \
$GH_API_ROOT/releases/assets/${{ steps.release.outputs.asset_id }}
fi
curl \
--fail \
-H "Authorization: Bearer ${{ steps.gh_app.outputs.token }}" \
-H "Accept: application/vnd.github.v3+json" \
-H "Content-Type: application/x-xz" \
-X POST \
--data-binary "@$HOME/openssl-${{ matrix.version }}.tar.xz" \
$GH_UPLOAD_ROOT/releases/${{ steps.release.outputs.release_id }}/assets?name=openssl-${{ matrix.version }}-ubuntu-20.04.tar.xz