mirror of
https://github.com/radareorg/radare2
synced 2026-08-22 20:23:32 -04:00
Jobs going master-only: filc, linux-acr-rpm-64, w64-static, msys2-w64-arm-meson, w64-arm-meson, freebsd Matrix change: macOS build only runs arm64 on PRs (drops x86_64)
950 lines
32 KiB
YAML
950 lines
32 KiB
YAML
name: build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
# Manual runs exercise the master-only jobs on any branch before merging.
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
# Superseded pushes to a PR cancel the previous run. Master runs are never
|
|
# cancelled mid-flight: a release is cut from a master push, and killing that
|
|
# run would drop the release. A newer master push waits behind the current one.
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
# Job gating
|
|
#
|
|
# This workflow only ever runs for three events: push to master, pull_request
|
|
# and workflow_dispatch. Jobs that produce release assets, cross-arch/toolchain
|
|
# duplicates and slow packaging jobs are gated with the single expression
|
|
#
|
|
# if: ${{ github.event_name != 'pull_request' }}
|
|
#
|
|
# which means "master push or manual dispatch". Use exactly that form (or the
|
|
# equivalent inside a fromJSON() matrix) so the master job set is easy to audit.
|
|
# Only check_release/release additionally require github.ref == refs/heads/master.
|
|
|
|
jobs:
|
|
linux-wasi:
|
|
runs-on: ubuntu-22.04
|
|
env:
|
|
WASI_ROOT: ${{ github.workspace }}/.wasi-cache
|
|
WASI_DOWNLOAD_DIR: ${{ github.workspace }}/.wasi-cache/distfiles
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
- name: Restore WASI SDK cache
|
|
uses: actions/cache@v6
|
|
with:
|
|
path: ${{ env.WASI_ROOT }}
|
|
key: ${{ runner.os }}-${{ runner.arch }}-wasi-sdk-${{ hashFiles('sys/wasi-env.sh') }}
|
|
- name: Installing with symlinks
|
|
run: sys/wasi.sh
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: linux-wasi
|
|
path: radare2-*-wasi.zip
|
|
|
|
# WASI API
|
|
linux-wasi-api:
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
# Serialize behind linux-wasi so the first master run after a cache-key
|
|
# change can reuse the freshly saved WASI SDK cache in this workflow.
|
|
needs: linux-wasi
|
|
runs-on: ubuntu-22.04
|
|
env:
|
|
WASI_ROOT: ${{ github.workspace }}/.wasi-cache
|
|
WASI_DOWNLOAD_DIR: ${{ github.workspace }}/.wasi-cache/distfiles
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
- name: Restore WASI SDK cache
|
|
uses: actions/cache@v6
|
|
with:
|
|
path: ${{ env.WASI_ROOT }}
|
|
key: ${{ runner.os }}-${{ runner.arch }}-wasi-sdk-${{ hashFiles('sys/wasi-env.sh') }}
|
|
- name: Installing with symlinks
|
|
run: sys/wasi-api.sh
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: linux-wasi-api
|
|
path: |
|
|
radare2-*-wasi-api.zip
|
|
|
|
# WASI Browser
|
|
linux-wasi-browser:
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
# Serialize behind linux-wasi so the first master run after a cache-key
|
|
# change can reuse the freshly saved WASI SDK cache in this workflow.
|
|
needs: linux-wasi
|
|
runs-on: ubuntu-22.04
|
|
env:
|
|
WASI_ROOT: ${{ github.workspace }}/.wasi-cache
|
|
WASI_DOWNLOAD_DIR: ${{ github.workspace }}/.wasi-cache/distfiles
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
- name: Restore WASI SDK cache
|
|
uses: actions/cache@v6
|
|
with:
|
|
path: ${{ env.WASI_ROOT }}
|
|
key: ${{ runner.os }}-${{ runner.arch }}-wasi-sdk-${{ hashFiles('sys/wasi-env.sh') }}
|
|
- name: Installing with symlinks
|
|
run: sys/wasi-browser.sh
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: linux-wasi-browser
|
|
path: radare2-*-wasi-browser.zip
|
|
|
|
# merged build with capstone, libuv and openssl
|
|
linux-deps:
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
- name: Installing with capstone, libuv and openssl
|
|
run: |
|
|
export CFLAGS=-Wl,--no-undefined
|
|
export LDFLAGS=-Wl,--no-undefined
|
|
cp -f dist/plugins-cfg/plugins.cs6.cfg plugins.cfg
|
|
./configure-plugins
|
|
sys/install.sh --with-capstone-next --with-libuv --with-ssl --with-ssl-crypto
|
|
- name: Running rahash2 tests
|
|
run: r2r test/db/tools/rahash2
|
|
# Source Tarballs
|
|
tarball:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
- name: Creating zip and tarball
|
|
run: sys/tarball.sh
|
|
- name: Building from the generated tarball
|
|
run: |
|
|
set -e
|
|
mkdir -p /tmp/tarball-build
|
|
tar -xf radare2-?.?.?.tar.xz -C /tmp/tarball-build
|
|
cd /tmp/tarball-build/radare2-*
|
|
./configure --prefix=/tmp/tarball-install
|
|
make -j$(nproc)
|
|
make install
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: tarball
|
|
path: radare2-?.?.?.*
|
|
|
|
filc:
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
- name: Extract r2 version
|
|
shell: bash
|
|
run: echo "branch=`./configure -qV`" >> $GITHUB_OUTPUT
|
|
id: r2v
|
|
- name: Install dependencies
|
|
run: sudo apt-get update && sudo apt-get install -y curl git gperf patchelf xz-utils
|
|
- name: Build with filc
|
|
run: ./sys/filc.sh --prefix=/opt/r2filc
|
|
- name: Install filc build
|
|
run: sudo make install
|
|
- name: Create filc tarball
|
|
run: tar -cJvf radare2-${{ steps.r2v.outputs.branch }}-filc.tar.xz /opt/r2filc
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: filc
|
|
path: radare2-*-filc.tar.xz
|
|
|
|
# Linux
|
|
linux-static:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
# amd64 (musl) is the only musl build, keep it on PRs. The i386 static
|
|
# build duplicates the gcc -m32 toolchain already exercised (with unit
|
|
# tests) by linux-acr-deb i386, so it only runs on master/dispatch.
|
|
arch: ${{ fromJSON(github.event_name != 'pull_request' && '["amd64", "i386"]' || '["amd64"]') }}
|
|
runner: [ubuntu-22.04]
|
|
# include:
|
|
# - arch: arm64
|
|
# runner: ubuntu-22.04-arm
|
|
runs-on: ${{ matrix.runner }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
- name: Extract r2 version
|
|
shell: bash
|
|
run: echo "branch=`./configure -qV`" >> $GITHUB_OUTPUT
|
|
id: r2v
|
|
- name: Installing the musl runtime
|
|
if: matrix.arch != 'i386'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y musl-tools
|
|
- name: Installing the i386 toolchain
|
|
if: matrix.arch == 'i386'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y gcc-multilib
|
|
- name: Building static r2 with acr
|
|
run: |
|
|
cp -f dist/plugins-cfg/plugins.static.nogpl.cfg plugins.cfg
|
|
if [ "${{ matrix.arch }}" = "i386" ]; then
|
|
# musl-tools only provides a native compiler on the runner.
|
|
export CFLAGS="-m32"
|
|
export LDFLAGS="-m32"
|
|
fi
|
|
sys/static.sh
|
|
make -C binr/blob
|
|
tar cJvf radare2-${{ steps.r2v.outputs.branch }}-static-${{ matrix.arch }}.tar.xz r2-static
|
|
- name: Pub
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: linux-static-${{ matrix.arch }}
|
|
path: radare2-*-static-${{ matrix.arch }}.tar.xz
|
|
|
|
linux-acr-rpm-64:
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
- name: Packaging for RPM
|
|
run: make -C dist/rpm
|
|
- name: Pub
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: linux-acr-rpm-64
|
|
path: dist/rpm/*.rpm
|
|
|
|
linux-acr-deb:
|
|
strategy:
|
|
fail-fast: false
|
|
# PRs only build i386: it is the leg that runs the 32-bit unit tests.
|
|
# amd64/arm64 are packaging duplicates and only run on master/dispatch.
|
|
matrix: ${{ fromJSON(github.event_name != 'pull_request' && '{"include":[{"arch":"amd64","runner":"ubuntu-22.04"},{"arch":"i386","runner":"ubuntu-22.04"},{"arch":"arm64","runner":"ubuntu-22.04-arm"}]}' || '{"include":[{"arch":"i386","runner":"ubuntu-22.04"}]}') }}
|
|
# TODO: Update to 22.04 when xpatch.c warnings have been fixed
|
|
runs-on: ${{ matrix.runner }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
- name: Installing the i386 crosscompiler
|
|
if: matrix.arch == 'i386'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y gcc-multilib gperf
|
|
- name: Packaging for Debian
|
|
run: |
|
|
gcc -v
|
|
sys/debian.sh ${{ matrix.arch }}
|
|
mv -v dist/debian/*/radare2*.deb .
|
|
- name: Installing i386 test dependencies
|
|
if: matrix.arch == 'i386'
|
|
run: |
|
|
python3 -m pip install --upgrade pip
|
|
pip3 install --user r2pipe wheel
|
|
make -C test bins
|
|
- name: Running i386 tests
|
|
if: matrix.arch == 'i386'
|
|
run: |
|
|
export R2_ROOT="${PWD}/dist/debian/radare2/root/usr"
|
|
export R2_DEV_ROOT="${PWD}/dist/debian/radare2-dev/root/usr"
|
|
export PATH="${R2_ROOT}/bin:${PATH}"
|
|
export LD_LIBRARY_PATH="${R2_ROOT}/lib"
|
|
export CC="gcc -m32"
|
|
export CFLAGS="-m32"
|
|
export LDFLAGS="-m32"
|
|
cd test
|
|
make rc
|
|
make -C unit run \
|
|
LIBDIR="${R2_ROOT}/lib" \
|
|
INCLUDEDIR="${R2_DEV_ROOT}/include/libr"
|
|
# testsuite on 32bit wont pass, lets just trust the unit
|
|
# r2r -L -u -o results-i386.json db/cmd
|
|
- name: Pub
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: linux-acr-deb-${{ matrix.arch }}
|
|
path: radare2*.deb
|
|
- name: Pub i386 test results
|
|
if: matrix.arch == 'i386'
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: linux-acr-deb-i386-tests
|
|
path: test/results-i386.json
|
|
|
|
## RPM PACKAGES DISABLED
|
|
# linux-meson-rpm:
|
|
# runs-on: ubuntu:22.04
|
|
# container: centos:8
|
|
# steps:
|
|
# - name: Checkout
|
|
# uses: actions/checkout@v7
|
|
# - 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@v7
|
|
# with:
|
|
# name: linux-meson-rpm
|
|
# path: *.rpm
|
|
#
|
|
# centos-meson-rpm:
|
|
# runs-on: ubuntu:22.04
|
|
# container: centos:8
|
|
# steps:
|
|
# - name: Checkout
|
|
# uses: actions/checkout@v7
|
|
# - 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@v7
|
|
# with:
|
|
# name: centos-meson-rpm
|
|
# path: *.rpm
|
|
#
|
|
|
|
|
|
# macOS
|
|
macos-acr:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
arch: ${{ fromJSON(github.event_name != 'pull_request' && '["arm64", "x86_64"]' || '["arm64"]') }}
|
|
runs-on: macos-15-intel
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
- name: Packaging
|
|
env:
|
|
ARCHFLAGS: '-arch ${{ matrix.arch }}'
|
|
CC: gcc -arch ${{ matrix.arch }}
|
|
LDFLAGS: '-headerpad_max_install_names' # Allow to relocate its dependencies using install_name_tool
|
|
run: make -C dist/macos
|
|
- name: Pub
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
path: dist/macos/*.pkg
|
|
name: macos-acr-${{ matrix.arch }}
|
|
|
|
ios:
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
type:
|
|
- cydia
|
|
- cydia32
|
|
include:
|
|
- type: cydia
|
|
sdk: true
|
|
runs-on: macos-15-intel
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Install ldid2 with Homebrew
|
|
run: brew install ldid
|
|
- name: Extract r2 version
|
|
shell: bash
|
|
run: echo "branch=`./configure -qV`" >> $GITHUB_OUTPUT
|
|
id: r2v
|
|
- name: Create ${{ matrix.type }} package
|
|
run: ROOTLESS=1 ./sys/ios-${{ matrix.type }}.sh
|
|
- if: ${{ matrix.sdk }}
|
|
name: Create iOS SDK
|
|
run: |
|
|
./sys/sdk-ios.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
|
|
- if: ${{ matrix.sdk }}
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: ios-${{ matrix.type }}
|
|
path: |
|
|
./dist/cydia/radare2/r2ios-sdk-*.zip
|
|
./dist/cydia/radare2/*.deb
|
|
- if: ${{ !matrix.sdk }}
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: ios-${{ matrix.type }}
|
|
path: ./dist/cydia/radare2/*.deb
|
|
|
|
# Android
|
|
android-acr:
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
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@v7
|
|
- 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@v7
|
|
with:
|
|
name: android-acr-${{ matrix.arch }}
|
|
path: radare2*android*${{ matrix.arch }}.tar.gz
|
|
|
|
android-sdk:
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get --assume-yes update
|
|
sudo apt-get --assume-yes install gperf python-is-python3 unzip wget zip
|
|
- name: Install Android NDK
|
|
run: sys/android-ndk-install.sh 28 arm64
|
|
- name: Build multi-ABI Android SDK
|
|
run: sys/android-sdk.sh --api 28
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: android-sdk
|
|
path: radare2-*-android-sdk.zip
|
|
if-no-files-found: error
|
|
compression-level: 0
|
|
|
|
# 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@v7
|
|
- 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=`./configure -qV`" >> $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@v7
|
|
with:
|
|
name: android-meson-${{ matrix.arch }}
|
|
path: /tmp/radare2-${{ steps.r2v.outputs.branch }}-android-${{ matrix.arch }}.tar.gz
|
|
|
|
|
|
# Windows
|
|
w32-meson:
|
|
# 32-bit MSVC duplicate of w64-meson (ci.yml also cross-builds w32-mingw)
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
runs-on: windows-2022
|
|
steps:
|
|
- name: Win configure Pagefile
|
|
uses: al-cheb/configure-pagefile-action@v1.5
|
|
with:
|
|
minimum-size: 16GB
|
|
maximum-size: 16GB
|
|
disk-root: "C:"
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
- uses: actions/setup-python@v7
|
|
with:
|
|
python-version: '3.10'
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install meson ninja r2pipe wget --break-system-packages
|
|
- name: Extract r2 version
|
|
shell: bash
|
|
run: echo "branch=`./configure -qV`" >> $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 -j4 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@v7
|
|
# 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@v7
|
|
with:
|
|
name: w32-meson
|
|
path: |
|
|
radare2-${{ steps.r2v.outputs.branch }}-w32.zip
|
|
# radare2-win-installer\Output\radare2.exe
|
|
w64-static:
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
runs-on: windows-2022
|
|
steps:
|
|
- name: Win configure Pagefile
|
|
uses: al-cheb/configure-pagefile-action@v1.5
|
|
with:
|
|
minimum-size: 16GB
|
|
maximum-size: 16GB
|
|
disk-root: "C:"
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
- uses: actions/setup-python@v7
|
|
with:
|
|
python-version: '3.10'
|
|
- name: Preparing nmake
|
|
uses: TheMrMilchmann/setup-msvc-dev@v4
|
|
with:
|
|
arch: x64
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install meson ninja r2pipe wget r2env --break-system-packages
|
|
- name: Extract r2 version
|
|
shell: bash
|
|
run: echo "branch=`./configure -qV`" >> $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.zip r2blob.static.exe
|
|
- uses: actions/upload-artifact@v7
|
|
continue-on-error: true
|
|
with:
|
|
name: w64-static
|
|
path: prefix\bin\r2blob-${{ steps.r2v.outputs.branch }}-w64.zip
|
|
|
|
w64-meson:
|
|
runs-on: windows-2022
|
|
steps:
|
|
- name: Win configure Pagefile
|
|
uses: al-cheb/configure-pagefile-action@v1.5
|
|
with:
|
|
minimum-size: 16GB
|
|
maximum-size: 16GB
|
|
disk-root: "C:"
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
- uses: actions/setup-python@v7
|
|
with:
|
|
python-version: '3.10'
|
|
- name: Preparing nmake
|
|
uses: TheMrMilchmann/setup-msvc-dev@v4
|
|
with:
|
|
arch: x64
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install meson ninja r2pipe wget --break-system-packages
|
|
- name: Extract r2 version
|
|
shell: bash
|
|
run: echo "branch=`./configure -qV`" >> $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
|
|
# -j4 matches w32-meson (same 4-vCPU runner + 16GB pagefile), which
|
|
# moved from -j1 to -j4 in 2cf6931a4f without issues.
|
|
ninja -C build -j4
|
|
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@v7
|
|
# 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@v7
|
|
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:
|
|
# PRs build MINGW64 only (msvcrt, the less conforming CRT and hence the
|
|
# one most likely to expose regressions); UCRT64 is added on master.
|
|
sys: ${{ fromJSON(github.event_name != 'pull_request' && '["MINGW64", "UCRT64"]' || '["MINGW64"]') }}
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- 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
|
|
|
|
msys2-w64-arm-meson:
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
runs-on: windows-11-arm
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
- name: Preparing MSVC for ARM64
|
|
uses: TheMrMilchmann/setup-msvc-dev@v4
|
|
with:
|
|
arch: arm64
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install meson ninja r2pipe wget --break-system-packages
|
|
- name: Extract r2 version
|
|
shell: bash
|
|
run: echo "branch=`./configure -qV`" >> $GITHUB_OUTPUT
|
|
id: r2v
|
|
- name: Build with meson + ninja
|
|
shell: pwsh
|
|
run: |
|
|
bash sys/source_bat.bash 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat' "arm64"
|
|
meson --buildtype=release --prefix=$PWD\radare2-${{ steps.r2v.outputs.branch }}-w64-arm64 -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-arm64.zip $PWD\radare2-${{ steps.r2v.outputs.branch }}-w64-arm64
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: msys2-w64-arm-meson
|
|
path: radare2-${{ steps.r2v.outputs.branch }}-w64-arm64.zip
|
|
|
|
w64-arm-meson:
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
runs-on: windows-11-arm
|
|
steps:
|
|
- name: Win configure Pagefile
|
|
uses: al-cheb/configure-pagefile-action@v1.5
|
|
with:
|
|
minimum-size: 16GB
|
|
maximum-size: 16GB
|
|
disk-root: "C:"
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
- uses: actions/setup-python@v7
|
|
with:
|
|
python-version: '3.12'
|
|
- name: Preparing MSVC for ARM64
|
|
uses: TheMrMilchmann/setup-msvc-dev@v4
|
|
with:
|
|
arch: arm64
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install meson ninja r2pipe wget --break-system-packages
|
|
- name: Extract r2 version
|
|
shell: bash
|
|
run: echo "branch=`./configure -qV`" >> $GITHUB_OUTPUT
|
|
id: r2v
|
|
- name: Build with meson + ninja
|
|
shell: pwsh
|
|
run: |
|
|
bash sys/source_bat.bash 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat' "arm64"
|
|
meson --buildtype=release --prefix=$PWD\radare2-${{ steps.r2v.outputs.branch }}-w64-arm64 -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-arm64.zip $PWD\radare2-${{ steps.r2v.outputs.branch }}-w64-arm64
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: w64-arm-meson
|
|
path: radare2-${{ steps.r2v.outputs.branch }}-w64-arm64.zip
|
|
|
|
# FreeBSD
|
|
freebsd:
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Extract r2 version
|
|
shell: bash
|
|
run: echo "branch=`./configure -qV`" >> $GITHUB_OUTPUT
|
|
id: r2v
|
|
- name: Build r2 in FreeBSD
|
|
uses: vmactions/freebsd-vm@v1
|
|
with:
|
|
usesh: true
|
|
cache-after-prepare: true
|
|
prepare: |
|
|
pkg install -y curl gmake patch git python gawk devel/py-pip
|
|
run: |
|
|
set -e
|
|
freebsd-version
|
|
python3 -m pip install --break-system-packages r2pipe
|
|
sys/install.sh
|
|
gmake install DESTDIR=/tmp/prefix
|
|
(cd /tmp/prefix && tar czf /tmp/radare2-freebsd.tgz *)
|
|
# r2r currently reports 6 unexpected failures on FreeBSD: four in
|
|
# db/cmd/sandbox (the exec grain, which is enforced by a different
|
|
# mechanism than on Linux), one type-naming case in db/cmd/types and
|
|
# one symlink case in db/cmd/projects. Run the suite so the results
|
|
# are visible, but do not gate the build job on them yet.
|
|
r2r test/db/cmd || true
|
|
cp /tmp/radare2-freebsd.tgz radare2-${{ steps.r2v.outputs.branch }}-freebsd.tgz
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: freebsd
|
|
path: radare2-*-freebsd.tgz
|
|
|
|
|
|
check_abi_compatibility:
|
|
if: contains(github.ref, 'invalid-commit-just-to-skip-that-job-until-rls-fixed')
|
|
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@v8
|
|
with:
|
|
name: linux-static-amd64
|
|
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
|
|
|
|
|
|
# XCFramework for release only
|
|
macos-xcframework:
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
runs-on: macos-15-intel
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
- name: Extract r2 version
|
|
shell: bash
|
|
run: echo "branch=`./configure -qV`" >> $GITHUB_OUTPUT
|
|
id: r2v
|
|
- name: Build XCFramework
|
|
run: |
|
|
make -C dist/sdk
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: macos-xcframework
|
|
path: dist/sdk/Radare2.xcframework.zip
|
|
|
|
# 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
|
|
- linux-wasi-api
|
|
- linux-wasi-browser
|
|
- tarball
|
|
- filc
|
|
# - linux-static
|
|
# - linux-acr-rpm-64
|
|
- linux-acr-deb
|
|
- macos-acr
|
|
- macos-xcframework
|
|
- ios
|
|
- android-acr
|
|
- android-sdk
|
|
# - android-meson
|
|
- w32-meson
|
|
- w64-meson
|
|
- w64-static
|
|
- w64-arm-meson
|
|
- msys2-w64-arm-meson
|
|
# - freebsd
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v7
|
|
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/filc/*.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/macos-xcframework/*.zip
|
|
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/android-sdk/radare2-*-android-sdk.zip
|
|
dist/artifacts/linux-acr-deb-*/radare2-dev_*.deb
|
|
dist/artifacts/linux-wasi/*.zip
|
|
dist/artifacts/linux-wasi-browser/*.zip
|
|
dist/artifacts/linux-wasi-api/*.zip
|
|
dist/artifacts/w64-static/*.zip
|
|
dist/artifacts/w64-arm-meson/*.zip
|
|
# dist/artifacts/linux-static-*/*.tar.xz
|
|
# dist/artifacts/msys2-w64-arm-meson/*.zip
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v7
|
|
with:
|
|
fetch-depth: 0 # Download all git history and tags
|
|
- name: Extract r2 version
|
|
shell: bash
|
|
run: echo "branch=`./configure -qV`" >> $GITHUB_OUTPUT
|
|
id: r2v
|
|
- name: Prepare release notes
|
|
run: ./sys/release-notes.sh | tee ./RELEASE_NOTES.md
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v8
|
|
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@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3.0.2
|
|
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
|