Bring back the linux packaging (just a zip) #233
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: r2dec CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
# Automatically cancel any previous workflow on new push. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} | |
cancel-in-progress: true | |
env: | |
R2V: 5.9.2 | |
jobs: | |
sources: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.7.x | |
- name: apt dependencies | |
run: sudo pip3 install meson ninja | |
- name: fetch dependencies via meson | |
run: meson subprojects download | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: r2dec-${{env.R2V}}-src-with-deps.zip | |
path: | | |
. | |
!.git/ | |
!.github/ | |
!.ci-scripts/ | |
!subprojects/libquickjs/.git/ | |
linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.7.x | |
- name: apt dependencies | |
run: sudo pip3 install meson ninja | |
- name: install r2 | |
run: | | |
wget -q https://github.com/radareorg/radare2/releases/download/${R2V}/radare2_${R2V}_amd64.deb | |
wget -q https://github.com/radareorg/radare2/releases/download/${R2V}/radare2-dev_${R2V}_amd64.deb | |
sudo dpkg -i *.deb | |
- name: make build | |
run: | | |
meson build | |
sudo ninja -C build install | |
- name: test with javascript files | |
run: | | |
r2 -Qc 'Lc' malloc://10 | |
OUTPUT=$(r2 -Qc 'af;pdd' /bin/ls) | |
CHECK=$(echo -e "$OUTPUT" | grep "r2dec pseudo code output") | |
echo -e "$OUTPUT" | |
if [ -z "$CHECK" ]; then | |
exit 1 | |
fi | |
sudo ninja -C build uninstall | |
- name: zip it up | |
run: | | |
cp -f build/libcore_pdd.so . | |
zip r2dec_${{env.R2V}}_linux_amd64.zip libcore_pdd.so | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: r2dec_${{env.R2V}}_linux_amd64.zip | |
path: r2dec_${{env.R2V}}_linux_amd64.zip | |
# - name: packaging | |
# run: make -C p/dist/debian | |
# - name: test deb | |
# run: | | |
# sudo dpkg -i p/dist/debian/*.deb | |
# dpkg-query -L r2dec | |
# r2 -Qc 'Lc' malloc://10 | |
# OUTPUT=$(r2 -Qc 'af;pdd' /bin/ls) | |
# CHECK=$(echo -e "$OUTPUT" | grep "r2dec pseudo code output") | |
# echo -e "$OUTPUT" | |
# if [ -z "$CHECK" ]; then | |
# exit 1 | |
# fi | |
# - uses: actions/upload-artifact@v4 | |
# with: | |
# name: r2dec-${{env.R2V}}_amd64.deb | |
# path: p/dist/debian/*.deb | |
# macos: | |
# runs-on: macos-latest | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - uses: actions/setup-python@v5 | |
# with: | |
# python-version: 3.7.x | |
# - name: homebrew dependencies | |
# run: | | |
# brew update | |
# brew install coreutils pkg-config | |
# pip3 install meson ninja | |
# - name: install r2 | |
# run: | | |
# wget -q https://github.com/radareorg/radare2/releases/download/${R2V}/radare2-x64-${R2V}.pkg | |
# sudo installer -pkg *.pkg -target / | |
# - name: packaging | |
# run: make -C p/dist/macos | |
# - uses: actions/upload-artifact@v4 | |
# with: | |
# name: r2dec-${{env.R2V}}-amd64.pkg | |
# path: p/dist/macos/r2dec*.pkg | |
w64: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.7.x | |
- name: Preparing msvc toolchain | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: x64 | |
- name: dependencies | |
shell: bash | |
run: | | |
pip install ninja meson wget | |
choco install winflexbison3 | |
choco install zip | |
- name: install r2 | |
shell: bash | |
run: | | |
python -m wget https://github.com/radareorg/radare2/releases/download/${R2V}/radare2-${R2V}-w64.zip -o r2.zip | |
unzip r2.zip | |
mv radare2-${R2V}-w64 radare2 | |
- name: meson | |
shell: cmd | |
run: | | |
set PKG_CONFIG_PATH=%CD%\radare2\lib\pkgconfig | |
set CFLAGS=-I%CD%\radare2\include | |
set LDFLAGS=-L%CD%\radare2\lib | |
set PATH=%CD%\radare2\bin;%PATH% | |
set DESTDIR=%CD%\r2dec-plugin | |
set BINDIR=%CD%\radare2\bin | |
set PLUGINDIR=%CD%\radare2\lib\plugins | |
set ARCH=x64 | |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 | |
meson --buildtype=release -Dr2_incdir="radare2\include\libr" build || exit /b 666 | |
ninja -C build || exit /b 666 | |
mkdir %DESTDIR% | |
copy build\*.dll %DESTDIR% || exit /b 666 | |
mkdir "%PLUGINDIR%" | |
copy build\*.dll "%PLUGINDIR%" || exit /b 666 | |
cd %BINDIR% | |
# deroad: disabled due inf loop in latest radare2 | |
# radare2.exe -qc "pdd? ; af ; pdd" radare2.exe | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: r2dec-${{env.R2V}}-w64.zip | |
path: r2dec-plugin | |
w32: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.7.x | |
- name: Preparing msvc toolchain | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: x86 | |
- name: dependencies | |
shell: bash | |
run: | | |
pip install ninja meson wget | |
choco install winflexbison3 | |
choco install zip | |
- name: install r2 | |
shell: bash | |
run: | | |
python -m wget https://github.com/radareorg/radare2/releases/download/${R2V}/radare2-${R2V}-w32.zip -o r2.zip | |
unzip r2.zip | |
mv radare2-${R2V}-w32 radare2 | |
- name: meson | |
shell: cmd | |
run: | | |
set PKG_CONFIG_PATH=%CD%\radare2\lib\pkgconfig | |
set CFLAGS=-I%CD%\radare2\include | |
set LDFLAGS=-L%CD%\radare2\lib | |
set PATH=%CD%\radare2\bin;%PATH% | |
set DESTDIR=%CD%\r2dec-plugin | |
set BINDIR=%CD%\radare2\bin | |
set PLUGINDIR=%CD%\radare2\lib\plugins | |
set ARCH=x86 | |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86 | |
meson --buildtype=release -Dr2_incdir="radare2\include\libr" build || exit /b 666 | |
ninja -C build || exit /b 666 | |
mkdir %DESTDIR% | |
copy build\*.dll %DESTDIR% || exit /b 666 | |
mkdir "%PLUGINDIR%" | |
copy build\*.dll "%PLUGINDIR%" || exit /b 666 | |
cd %BINDIR% | |
# deroad: disabled due inf loop in latest radare2 | |
# radare2.exe -qc "pdd? ; af ; pdd" radare2.exe | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: r2dec-${{env.R2V}}-w32.zip | |
path: r2dec-plugin |