mirror of
https://github.com/radareorg/github-actions.git
synced 2026-11-07 06:25:58 -10:00
v3
Install Radare2 GitHub Action
Composite GitHub Action to install radare2 in CI workflows. Supports Linux, macOS and Windows runners, with options to install from release packages or build from git source.
Usage
Reference the action from your workflow:
- uses: radareorg/github-actions@v3
Inputs
| Input | Description | Default |
|---|---|---|
version |
Radare2 version to install (e.g., 6.1.2). Empty for latest. |
"" (latest) |
from-git |
Build from git source instead of release packages. | false |
prefix |
Installation prefix. Release packages install to the platform default; a custom prefix requires from-git. |
/usr on Linux, /usr/local on macOS, RUNNER_TEMP/radare2 on Windows |
Outputs
| Output | Description |
|---|---|
version |
Installed radare2 version |
prefix |
Installation prefix path |
Examples
Install latest release
steps:
- uses: radareorg/github-actions@v3
Install a specific version
steps:
- uses: radareorg/github-actions@v3
with:
version: '6.1.2'
Build latest git from source
steps:
- uses: radareorg/github-actions@v3
with:
from-git: true
Build a specific version from source
steps:
- uses: radareorg/github-actions@v3
with:
version: '6.1.2'
from-git: true
Custom install prefix
steps:
- uses: radareorg/github-actions@v3
with:
from-git: true
prefix: '/opt/radare2'
Build from git on Windows
steps:
- uses: actions/checkout@v7
- uses: TheMrMilchmann/setup-msvc-dev@v4
with:
arch: x64
- uses: radareorg/github-actions@v3
with:
from-git: true
Multi-platform CI with build matrix
name: CI
on:
push:
branches: ['**']
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-latest, windows-latest]
build_system: [make, meson]
exclude:
- os: windows-latest
build_system: make
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- uses: radareorg/github-actions@v3
id: r2
- name: Build with Make
if: matrix.build_system == 'make'
run: make
- name: Setup Meson
if: matrix.build_system == 'meson'
run: pip install meson ninja --break-system-packages
- name: Build with Meson
if: matrix.build_system == 'meson'
run: |
meson setup build
meson compile -C build
Using outputs
steps:
- uses: radareorg/github-actions@v3
id: r2
- run: echo "Installed r2 ${{ steps.r2.outputs.version }} at ${{ steps.r2.outputs.prefix }}"
How it works
The operating system is auto-detected from the runner:
- Linux - Downloads and installs
.debpackages (radare2+radare2-dev) under/usr. Architecture is detected viadpkg --print-architecture. - macOS - Downloads and installs
.pkgpackage under/usr/local. Detectsarm64vsx86_64automatically. - Windows - Downloads and extracts the
.ziprelease using PowerShell, handles nested subdirectories automatically, then addsbin/toPATH.
When from-git is true, the action clones the radare2 repository and builds from source using sys/install.sh on Unix or meson/ninja on Windows.
Notes
- Windows git builds use meson/ninja and require a Visual C++ environment. Add
TheMrMilchmann/setup-msvc-dev@v4witharch: x64before this action if building from source on Windows. - Both
radare2andradare2-devpackages are installed on Linux so headers and pkg-config files are available for building plugins. - The action verifies the installation by running
radare2 -vat the end. - Use
concurrencywithcancel-in-progress: trueto avoid wasting CI minutes on superseded pushes. - Use
fail-fast: falsein matrix builds so a failure on one platform doesn't cancel the others.
Releases
1