-
-
Notifications
You must be signed in to change notification settings - Fork 3k
734 lines (712 loc) · 22.7 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
name: build
on:
push:
branches:
- master
pull_request:
jobs:
# WASI
linux-wasi:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Installing with symlinks
run: sys/wasi.sh
- uses: actions/upload-artifact@v4
with:
name: linux-wasi
path: radare2-*-wasi.zip
# WASI API
linux-wasi-api:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Installing with symlinks
run: sys/wasi-api.sh
- uses: actions/upload-artifact@v4
with:
name: linux-wasi-api
path: radare2-*-wasi-api.zip
# capstone-next
linux-csnext:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Installing with symlinks
run: |
cp -f dist/plugins-cfg/plugins.cs6.cfg plugins.cfg
./configure-plugins
sys/install.sh --with-capstone-next
linux-ssl-crypto:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Installing with ssl crypto
run: |
sys/install.sh --with-ssl-crypto
# Source Tarballs
tarball:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Creating zip and tarball
run: sys/tarball.sh
- uses: actions/upload-artifact@v4
with:
name: tarball
path: radare2-?.?.?.*
# Linux
linux-static:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract r2 version
shell: bash
run: echo "branch=`sys/version.py -n`" >> $GITHUB_OUTPUT
id: r2v
- name: Installing the musl runtime
run: |
sudo apt update --assume-yes
sudo apt install --assume-yes musl-tools
- name: Building static r2 with acr
run: |
cp -f dist/plugins-cfg/plugins.static.nogpl.cfg plugins.cfg
NOLTO=1 sys/static.sh
# NOLTO=1 sys/static.sh
make -C binr/blob
tar cJvf radare2-${{ steps.r2v.outputs.branch }}-static.tar.xz r2-static
- name: Pub
uses: actions/upload-artifact@v4
with:
name: linux-static
path: radare2-*-static.tar.xz
linux-acr-rpm-64:
# if: contains(github.ref, 'master') || contains(github.ref, 'ci-')
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Packaging for RPM
run: make -C dist/rpm
- name: Pub
uses: actions/upload-artifact@v4
with:
name: linux-acr-rpm-64
path: dist/rpm/*.rpm
linux-acr-deb:
# if: contains(github.ref, 'master') || contains(github.ref, 'ci-')
strategy:
fail-fast: false
matrix:
arch:
- amd64
- arm64
- i386
include:
- arch: arm64
gcc: aarch64-linux-gnu
- arch: i386
gcc: multilib
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- if: ${{ matrix.gcc }}
name: Installing crosscompiler
run: |
sudo apt update --assume-yes
sudo apt install --assume-yes gcc-${{ matrix.gcc }} gperf
- name: Packaging for Debian
run: |
gcc -v
sys/debian.sh ${{ matrix.arch }}
mv -v dist/debian/*/radare2*.deb .
- name: Pub
uses: actions/upload-artifact@v4
with:
name: linux-acr-deb-${{ matrix.arch }}
path: radare2*.deb
## RPM PACKAGES DISABLED
# linux-meson-rpm:
# runs-on: ubuntu:20.04
# container: centos:8
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Prepare Skeleton
# run: |
# mkdir -p SOURCES SPECS
# cp -f dist/rpm/*spec SPECS
# wget -O https://github.com/radareorg/radare2/archive/master/radare2-5.1.0-git.tar.gz
# - name: rpmbuild
# uses: robertdebock/rpmbuild-action@1.1.1
# - name: Organize artifacts
# run: mv -v RPMS/*/*.rpm dist/rpm/*.rpm .
# - name: Pub
# uses: actions/upload-artifact@v4
# with:
# name: linux-meson-rpm
# path: *.rpm
#
# centos-meson-rpm:
# runs-on: ubuntu:20.04
# container: centos:8
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Install tools for CentOS:8
# run: |
# yum install -y patch unzip git gcc make python38 python38-pip rpm-build rpmdevtools wget
# pip3.8 install meson ninja r2pipe
# - name: Building with Meson
# run: |
# meson build
# ninja -C build
# ninja -C build install
# - name: RPM Packaging
# run: |
# cp -f dist/rpm/radare2.spec .
# rpmdev-setuptree
# mkdir -p rpmbuild/SOURCES
# cd rpmbuild/SOURCES
# wget https://github.com/radareorg/radare2/archive/5860c3efc12d4b75e72bdce4b1d3834599620913/radare2-5.1.0-git.tar.gz
# cd -
# rpmbuild -ba radare2.spec
# mv -v rpmbuild/RPMS/*/*.rpm .
# - name: Pub
# uses: actions/upload-artifact@v4
# with:
# name: centos-meson-rpm
# path: *.rpm
#
# macOS
macos-acr:
strategy:
fail-fast: false
matrix:
include:
- arch: arm64
macos: 13
- arch: x86_64
macos: 12
runs-on: macos-${{ matrix.macos }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pkg-config with Homebrew
run: brew install pkg-config
- name: Packaging
env:
ARCHFLAGS: '-arch ${{ matrix.arch }}'
CC: gcc -arch ${{ matrix.arch }}
run: make -C dist/macos
- name: Pub
uses: actions/upload-artifact@v4
with:
path: dist/macos/*.pkg
name: macos-acr-${{ matrix.arch }}
ios:
if: contains(github.ref, 'master') || contains(github.ref, 'ci-')
strategy:
fail-fast: false
matrix:
type:
- cydia
- cydia32
include:
- type: cydia
sdk: true
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- name: Install pkg-config/ldid2 with Homebrew
run: brew install pkg-config ldid
- name: Extract r2 version
shell: bash
run: echo "branch=`sys/version.py -n`" >> $GITHUB_OUTPUT
id: r2v
- name: Create ${{ matrix.type }} package
run: ./sys/ios-${{ matrix.type }}.sh
- if: ${{ matrix.sdk }}
name: Create iOS SDK
run: |
./sys/ios-sdk.sh
pushd /tmp/r2ios
zip -r /tmp/r2ios-sdk.zip *
popd
mv /tmp/r2ios-sdk.zip dist/cydia/radare2/r2ios-sdk-${{ steps.r2v.outputs.branch }}.zip
- uses: actions/upload-artifact@v4
with:
name: ios-${{ matrix.type }}
path: |
./dist/cydia/radare2/r2ios-sdk-*.zip
./dist/cydia/radare2/*.deb
# Android
android-acr:
if: contains(github.ref, 'master') || contains(github.ref, 'ci-')
strategy:
fail-fast: false
matrix:
arch:
- aarch64
- arm
include: # Force API 16 only for ARM (32 bits)
- arch: arm
api: 16
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get --assume-yes update
sudo apt-get --assume-yes install pax wget gperf cabextract unzip python3-wheel python3-setuptools python3-pip
sudo pip3 install --user meson ninja --break-system-packages
- name: Compile with acr
run: |
sys/android-ndk-install.sh "${{ matrix.api }}" "${{ matrix.arch }}"
sys/android-build.sh "${{ matrix.arch }}"
ls -l
- uses: actions/upload-artifact@v4
with:
name: android-acr-${{ matrix.arch }}
path: radare2*android*${{ matrix.arch }}.tar.gz
# disabled because the ndk link is broken for a while
android-meson:
if: contains(github.ref, 'android')
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
arch:
- x86_64
# - aarch64
# - arm
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get --assume-yes update
sudo apt-get --assume-yes install pax wget cabextract unzip python3-wheel python3-setuptools python3-pip
sudo pip3 install --user meson ninja --break-system-packages
- name: Extract r2 version
shell: bash
run: echo "branch=`sys/version.py -n`" >> $GITHUB_OUTPUT
id: r2v
- name: Compile with meson
run: |
export PATH=${HOME}/.local/bin:${PATH}
CFLAGS="-static" LDFLAGS="-static" meson --buildtype release --default-library static --prefix=/tmp/android-dir -Dblob=true build --cross-file .github/meson-android-${{ matrix.arch }}.ini
ninja -C build && ninja -C build install
- name: Create radare2-${{ steps.r2v.outputs.branch }}-android-${{ matrix.arch }}.tar.gz
run: |
cd /tmp
rm -rf android-dir/include android-dir/lib
tar --transform 's/android-dir/data\/data\/org.radareorg.radare2installer/g' -czvf radare2-${{ steps.r2v.outputs.branch }}-android-${{ matrix.arch }}.tar.gz android-dir/
- uses: actions/upload-artifact@v4
with:
name: android-meson-${{ matrix.arch }}
path: /tmp/radare2-${{ steps.r2v.outputs.branch }}-android-${{ matrix.arch }}.tar.gz
# Windows
w32-meson:
runs-on: windows-2019
steps:
- name: Win configure Pagefile
uses: al-cheb/configure-pagefile-action@v1.4
with:
minimum-size: 16GB
maximum-size: 16GB
disk-root: "C:"
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install git+https://github.com/frida/meson.git@f7f25b19a8d71cebf8e2934733eb041eb6862eee --break-system-packages
pip install ninja r2pipe wget --break-system-packages
- name: Extract r2 version
shell: bash
run: echo "branch=`sys/version.py -n`" >> $GITHUB_OUTPUT
id: r2v
- name: Build with meson + ninja
shell: pwsh
run: |
.github\vsdevenv.ps1
meson --buildtype=release --prefix=$PWD\radare2-${{ steps.r2v.outputs.branch }}-w32 -Dc_std=c11 build
ninja -C build -j1 install
- name: Create zip artifact
run: 7z a radare2-${{ steps.r2v.outputs.branch }}-w32.zip $PWD\radare2-${{ steps.r2v.outputs.branch }}-w32
# - uses: actions/checkout@v4
# with:
# repository: radareorg/radare2-win-installer
# path: ./radare2-win-installer
# - name: Create installer
# shell: pwsh
# run: iscc radare2-win-installer\radare2.iss /DRadare2Location=..\radare2-install\* /DLicenseLocation=..\COPYING.LESSER /DIcoLocation=radare2.ico /DMyAppVersion=${{ steps.r2v.outputs.branch }}
- uses: actions/upload-artifact@v4
with:
name: w32-meson
path: |
radare2-${{ steps.r2v.outputs.branch }}-w32.zip
# radare2-win-installer\Output\radare2.exe
w64-static-2022:
runs-on: windows-2022
steps:
- name: Win configure Pagefile
uses: al-cheb/configure-pagefile-action@v1.4
with:
minimum-size: 16GB
maximum-size: 16GB
disk-root: "C:"
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Preparing nmake
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Install dependencies
run: |
pip install git+https://github.com/frida/meson.git@f7f25b19a8d71cebf8e2934733eb041eb6862eee --break-system-packages
pip install ninja r2pipe wget r2env --break-system-packages
- name: Extract r2 version
shell: bash
run: echo "branch=`sys/version.py -n`" >> $GITHUB_OUTPUT
id: r2v
- name: preconfigure
continue-on-error: true
shell: cmd
run: preconfigure
- name: Build with meson + ninja
shell: cmd
run: |
call configure static
call make
- name: Test executable
continue-on-error: true
shell: cmd
run: |
cd prefix\bin
r2blob -v
- name: Zipping Executable
shell: cmd
run: |
cd prefix\bin
dir
7z a r2blob-${{ steps.r2v.outputs.branch }}-w64-2022.zip r2blob.static.exe
- uses: actions/upload-artifact@v4
continue-on-error: true
with:
name: w64-static-2022
path: prefix\bin\r2blob-${{ steps.r2v.outputs.branch }}-w64-2022.zip
w64-static:
runs-on: windows-2019
steps:
- name: Win configure Pagefile
uses: al-cheb/configure-pagefile-action@v1.4
with:
minimum-size: 16GB
maximum-size: 16GB
disk-root: "C:"
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Preparing nmake
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Install dependencies
run: |
pip install git+https://github.com/frida/meson.git@f7f25b19a8d71cebf8e2934733eb041eb6862eee --break-system-packages
pip install ninja r2pipe wget r2env --break-system-packages
- name: Extract r2 version
shell: bash
run: echo "branch=`sys/version.py -n`" >> $GITHUB_OUTPUT
id: r2v
- name: Build with meson + ninja
shell: cmd
run: |
REM preconfigure
call configure static
call make
- name: Test executable
continue-on-error: true
shell: cmd
run: |
cd prefix\bin
r2blob -v
- name: Zipping Executable
shell: cmd
run: |
cd prefix\bin
dir
7z a r2blob-${{ steps.r2v.outputs.branch }}-w64.zip r2blob.static.exe
- uses: actions/upload-artifact@v4
continue-on-error: true
with:
name: w64-static
path: prefix\bin\r2blob-${{ steps.r2v.outputs.branch }}-w64.zip
w64-meson:
runs-on: windows-2019
steps:
- name: Win configure Pagefile
uses: al-cheb/configure-pagefile-action@v1.4
with:
minimum-size: 16GB
maximum-size: 16GB
disk-root: "C:"
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Preparing nmake
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Install dependencies
run: |
pip install git+https://github.com/frida/meson.git@f7f25b19a8d71cebf8e2934733eb041eb6862eee --break-system-packages
pip install ninja r2pipe wget --break-system-packages
- name: Extract r2 version
shell: bash
run: echo "branch=`sys/version.py -n`" >> $GITHUB_OUTPUT
id: r2v
- name: Build with meson + ninja
shell: pwsh
run: |
# cmd '/c call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" "x86_64"'
bash sys/source_bat.bash 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat' "x86_64"
# meson_options: --default-library=shared|static -Dstatic_runtime=true --backend vs2019
meson --buildtype=release --prefix=$PWD\radare2-${{ steps.r2v.outputs.branch }}-w64 -Dc_std=c11 build
ninja -C build -j 1
ninja -C build install
- name: Create zip artifact
run: 7z a radare2-${{ steps.r2v.outputs.branch }}-w64.zip $PWD\radare2-${{ steps.r2v.outputs.branch }}-w64
# - uses: actions/checkout@v4
# with:
# repository: radareorg/radare2-win-installer
# path: ./radare2-win-installer
# - name: Create installer
# shell: pwsh
# run: iscc radare2-win-installer\radare2.iss /DRadare2Location=..\radare2-install\* /DLicenseLocation=..\COPYING.LESSER /DIcoLocation=radare2.ico /DMyAppVersion=${{ steps.r2v.outputs.branch }}
- uses: actions/upload-artifact@v4
with:
name: w64-meson
path: |
radare2-${{ steps.r2v.outputs.branch }}-w64.zip
# radare2-win-installer\Output\radare2.exe
msys2-w64-meson:
strategy:
fail-fast: false
matrix:
sys: [MINGW64, UCRT64]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}
update: true
install: base-devel git
pacboy: >-
cc:p
meson:p
ninja:p
- name: Configure Build
shell: msys2 {0}
run: |
prefix=$(case "${{ matrix.sys }}" in
MINGW64) echo /mingw64 ;;
UCRT64) echo /ucrt64 ;;
esac)
meson setup build --prefix=$prefix
- name: Compile Project
shell: msys2 {0}
run: meson compile -C build
# FreeBSD
# freebsd:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Extract r2 version
# shell: bash
# run: echo "branch=`sys/version.py -n`" >> $GITHUB_OUTPUT
# id: r2v
# - name: Build r2 in FreeBSD
# id: build
# uses: vmactions/freebsd-vm@v1
# with:
# usesh: true
# prepare: pkg install -y curl gmake patch git python gawk
# run: |
# cd work || true
# pwd
# ls -lah
# whoami
# env
# freebsd-version
# echo DATE: ; date
# pip install r2pipe
# sys/install.sh
# gmake install DESTDIR=/tmp/prefix
# (cd /tmp/prefix ; tar czvf /tmp/radare2-freebsd.tgz *)
# r2r test/db/cmd
# rm -rf * .git*
# cp /tmp/radare2-freebsd.tgz radare2-${{ steps.r2v.outputs.branch }}-freebsd.tgz
# echo DATE: ; date
# - uses: actions/upload-artifact@v4
# with:
# name: freebsd
# path: radare2-*-freebsd.tgz
check_abi_compatibility:
if: contains(github.ref, 'de345ee04d0777b462f2f98ac383c883')
needs:
- linux-static
runs-on: ubuntu-24.04
defaults:
run:
shell: bash
working-directory: /tmp
steps:
- name: Install dependencies
run: |
# sudo apt install --assume-yes abigail-tools wget
# ubuntu-latest is TOO OLD and it ships abigail 2.0 which is known to be buggy
wget https://ftp.fau.de/debian/pool/main/liba/libabigail/libabigail0_2.2-2_amd64.deb
sudo dpkg -i libabigail0_2.2-2_amd64.deb
wget https://ftp.fau.de/debian/pool/main/liba/libabigail/libabigail-dev_2.2-2_amd64.deb
sudo dpkg -i libabigail-dev_2.2-2_amd64.deb
wget https://ftp.fau.de/debian/pool/main/liba/libabigail/abigail-tools_2.2-2_amd64.deb
sudo dpkg -i abigail-tools_2.2-2_amd64.deb
- name: Download Build
uses: actions/download-artifact@v4
with:
name: linux-static
path: /tmp
- name: Download latest release
run: |
DOWNLOAD_URL=$(curl -s \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
https://api.github.com/repos/radareorg/radare2/releases/latest \
| jq -r '.assets[] | select(.name | startswith("radare2")) | select(.name | endswith("static.tar.xz")) | .browser_download_url')
wget -O r2-static-latest.tar.xz $DOWNLOAD_URL
- name: Untar
run: |
mkdir r2-static
tar -xvf radare2-*-static.tar.xz -C r2-static --strip-components=1
mkdir r2-static-latest
tar -xvf r2-static-latest.tar.xz -C r2-static-latest --strip-components=1
- name: ABI compatibility check
run: |
A=abidiff.conf
echo '[suppress_function]' > $A
echo 'name_regexp = .*java.*' >> $A
echo '[suppress_function]' >> $A
echo 'name_not_regexp = ^r_.*' >> $A
echo '[suppress_function]' >> $A
echo 'name_regexp = r_bin_add_import' >> $A
echo '[suppress_variable]' >> $A
echo 'name_not_regexp = ^r_.*' >> $A
for lib in r2-static-latest/usr/lib/libr_*.so; do
echo $lib ; abidiff --suppr $A ${lib} r2-static/usr/lib/$(basename ${lib});
done
# Release creation
check_release:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
outputs:
is_release: ${{ steps.release.outputs.is }}
tag_name: ${{ steps.release.outputs.tag }}
needs:
- linux-wasi
- tarball
- linux-static
# - linux-acr-rpm-64
- linux-acr-deb
- macos-acr
- ios
- android-acr
# - android-meson
- w32-meson
- w64-meson
- w64-static
# - freebsd
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Download all git history and tags
- name: Check if is a release
run: |
TAG="`git describe --exact-match --tags ${{ github.sha }} || true`"
if [ -n "$TAG" ]; then
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "is=yes" >> $GITHUB_OUTPUT
else
echo "is=no" >> $GITHUB_OUTPUT
fi
id: release
release:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && needs.check_release.outputs.is_release == 'yes' }}
needs:
- check_release
runs-on: ubuntu-24.04
env:
ASSET_FILES: |
dist/artifacts/tarball/*.tar.xz
dist/artifacts/linux-acr-deb-*/radare2_*.deb
dist/artifacts/w64-meson/*.zip
dist/artifacts/w32-meson/*.zip
dist/artifacts/macos-acr-*/*.pkg
dist/artifacts/ios-cydia/*.deb
dist/artifacts/ios-cydia32/*.deb
dist/artifacts/ios-cydia/r2ios-sdk-*.zip
dist/artifacts/android-acr-*/*.tar.gz
dist/artifacts/linux-static/*.tar.xz
dist/artifacts/linux-acr-deb-*/radare2-dev_*.deb
dist/artifacts/linux-wasi/*.zip
dist/artifacts/linux-wasi-api/*.zip
dist/artifacts/w64-static/*.zip
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Download all git history and tags
- name: Extract r2 version
shell: bash
run: echo "branch=`sys/version.py -n`" >> $GITHUB_OUTPUT
id: r2v
- name: Prepare release notes
run: ./sys/release-notes.sh | tee ./RELEASE_NOTES.md
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist/artifacts
- name: Generate checksums
run: sha256sum $ASSET_FILES | awk '{sub(".*/", "", $2); print $1" "$2}' > checksums.txt
- name: Create GitHub release
id: create_release
uses: softprops/action-gh-release@975c1b265e11dd76618af1c374e7981f9a6ff44a
with:
name: ${{ steps.r2v.outputs.branch }}
tag_name: ${{ needs.check_release.outputs.tag_name }}
body_path: ./RELEASE_NOTES.md
draft: false
prerelease: false
generate_release_notes: false
files: |
${{ env.ASSET_FILES }}
checksums.txt