WIP branch supporting latest ghidra-native-0.5.0 #544
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: ci | |
env: | |
R2V: 5.9.0 | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
r2git: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Installing radare2 from git | |
run: ( git clone --depth=1 https://github.com/radareorg/radare2 && cd radare2 && sys/install.sh /usr ) | |
- name: Building r2ghidra with acr | |
run: ./preconfigure && ./configure --prefix=/usr && make -j4 ; make user-install | |
- name: Testing r2ghidra oneliner on home setup | |
run: R2_DEBUG=1 r2 -qc 'af;pdg' /bin/ls | tee a.txt && grep entry0 a.txt | |
- name: System-wide installation | |
run: make user-uninstall && sudo make install | |
- name: Testing r2ghidra oneliner on system wide install | |
run: R2_DEBUG=1 r2 -qc 'af;pdg' /bin/ls | tee a.txt && grep entry0 a.txt | |
- name: Packaging r2ghidra for Debian | |
run: make -C dist/debian | |
- name: Running Testsuite | |
run: make -C test || exit 0 | |
linux-deb: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Installing radare2 from deb | |
run: | | |
wget https://github.com/radareorg/radare2/releases/download/5.9.0/radare2_5.9.0_amd64.deb | |
wget https://github.com/radareorg/radare2/releases/download/5.9.0/radare2-dev_5.9.0_amd64.deb | |
sudo dpkg -i *.deb | |
- name: Building r2ghidra with acr | |
run: ./preconfigure && ./configure --prefix=/usr && make -j4 ; make user-install | |
- name: Testing r2ghidra oneliner on home setup | |
run: R2_DEBUG=1 r2 -qc 'af;pdg' /bin/ls | tee a.txt && grep entry0 a.txt | |
- name: System-wide installation | |
run: make user-uninstall && sudo make install | |
- name: Testing r2ghidra oneliner on system wide install | |
run: R2_DEBUG=1 r2 -qc 'af;pdg' /bin/ls | tee a.txt && grep entry0 a.txt | |
- name: Packaging r2ghidra for Debian using Dockcross | |
run: make -C dist/debian | |
- name: Running Testsuite | |
run: make -C test || exit 0 | |
- name: Uploading debs | |
uses: actions/upload-artifact@v4 | |
with: | |
# path: radare2/dist/debian/*/*.deb r2ghidra/dist/debian/*.deb | |
name: linux-deb | |
path: dist/debian/*.deb | |
- name: Precompiling the sleigh | |
run: make dist | |
- name: Uploading sleigh | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux-acr-ok | |
path: r2ghidra_sleigh-*.zip | |
tarball: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Installing radare2 from deb | |
run: | | |
wget https://github.com/radareorg/radare2/releases/download/5.9.0/radare2_5.9.0_amd64.deb | |
wget https://github.com/radareorg/radare2/releases/download/5.9.0/radare2-dev_5.9.0_amd64.deb | |
sudo dpkg -i *.deb | |
rm *.deb | |
- name: Building tars | |
run: make -C dist/tarball | |
- name: Uploading balls | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tarball | |
path: dist/tarball/r2ghidra-* | |
linux-asan: | |
if: ${{ false }} # disable for now | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Installing radare2 | |
# run: ( git clone --depth=1 --branch "${R2V}" https://github.com/radareorg/radare2 && cd radare2 && sys/sanitize.sh --install /usr ) | |
run: ( git clone --depth=1 --branch "${R2V}" https://github.com/radareorg/radare2 && cd radare2 && sys/install.sh --install ) | |
- name: Building r2ghidra with acr | |
run: ./preconfigure && ./configure && make asan && make -C src sleigh-build && make user-install | |
- name: Testing r2ghidra oneliner | |
run: | | |
r2 -qc 'af;pdg' /bin/ls | tee a.txt | |
grep entry0 a.txt | |
linux-meson: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Downloading Radare2 Debian packages | |
run: | | |
wget -O r2.deb https://github.com/radareorg/radare2/releases/download/${{env.R2V}}/radare2_${{env.R2V}}_amd64.deb | |
wget -O r2-dev.deb https://github.com/radareorg/radare2/releases/download/${{env.R2V}}/radare2-dev_${{env.R2V}}_amd64.deb | |
- name: Installing Radare2 | |
run: sudo dpkg -i r2.deb r2-dev.deb | |
- name: Installing User's Meson Ninja | |
run: pip install ninja meson && ninja --version && meson --version | |
- name: Installing System's Meson Ninja | |
run: sudo pip install ninja meson && sudo ninja --version && sudo meson --version | |
- name: Building r2ghidra with meson | |
run: ./preconfigure && meson b && ninja -C b && sudo ninja -C b install | |
- name: Cannot test meson builds, because those cant be installed yet | |
run: echo nada | |
# - name: Testing r2ghidra oneliner | |
# run: | | |
# r2 -H | |
# r2 -L | |
# R2_DEBUG=1 r2 -qc 'af;pdg' /bin/ls | tee a.txt | |
# grep entry0 a.txt | |
macos-pkg: | |
# The type of runner that the job will run on | |
runs-on: macos-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cloning Radare2 git repository | |
run: git clone --depth=1 --branch "${R2V}" https://github.com/radareorg/radare2 | |
- name: Building Radare2 pkg for macOS | |
run: make -C radare2/dist/macos | |
- name: Install radare2 Package | |
run: sudo installer -pkg radare2/dist/macos/*.pkg -target / | |
- name: Building r2ghidra with acr | |
run: ./preconfigure && ./configure && make -j4 && make user-install | |
- name: Packaging r2ghidra | |
run: | | |
make -C dist/macos | |
make install DESTDIR=/tmp/r2ghidra && cd /tmp/r2ghidra && tar czvf ../r2ghidra-macos.tar.gz * | |
- name: Testing r2ghidra | |
run: | | |
r2 -qc 'af;pdg' test/bins/rec | tee a.txt | |
grep csu_init a.txt | |
- name: Uploading artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macos-pkg | |
path: dist/macos/*.zip | |
#path: radare2/dist/macos/*.pkg src/*.dylib /tmp/r2ghidra-macos.tar.gz dist/macos/*.zip | |
w64: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v1 | |
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 | |
- name: install r2 | |
shell: bash | |
run: | | |
python -m wget https://github.com/radareorg/radare2/releases/download/${{env.R2V}}/radare2-${{env.R2V}}-w64.zip -o r2.zip | |
python3 -m zipfile -e r2.zip . | |
mv radare2-${{env.R2V}}-w64 radare2 | |
pwd | |
- name: batmake | |
shell: cmd | |
run: | | |
call preconfigure.bat | |
call configure.bat | |
call make.bat | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: w64 | |
path: destdir/r2ghidra-w64.zip | |
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-deb | |
- macos-pkg | |
- w64 | |
runs-on: ubuntu-latest | |
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: git describe --exact-match --tags ${{ github.sha }} | awk 'BEGIN{tag="-";r="no"}/^[0-9]+\.[0-9]+/{tag=$0;r="yes"};END{print "is="r;print "tag="tag}' >> ${GITHUB_OUTPUT} | |
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-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Download all git history and tags | |
- name: Extract r2g version | |
run: echo "branch=`./configure -qV`" >> $GITHUB_OUTPUT | |
id: r2gv | |
- name: Prepare release notes | |
run: echo Release > ./RELEASE_NOTES.md | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: dist/artifacts | |
- name: Create GitHub release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ needs.check_release.outputs.tag_name }} | |
release_name: ${{ steps.r2gv.outputs.branch }} | |
body_path: ./RELEASE_NOTES.md | |
draft: false | |
prerelease: false | |
- name: Upload asset for Linux | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist/artifacts/linux-deb/r2ghidra_${{ steps.r2gv.outputs.branch }}_amd64.deb | |
asset_name: r2ghidra_${{ steps.r2gv.outputs.branch }}_amd64.deb | |
asset_content_type: application/vnd.debian.binary-package | |
- name: Upload asset for macOS | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist/artifacts/macos-pkg/r2ghidra-${{ steps.r2gv.outputs.branch }}-macos.zip | |
asset_name: r2ghidra-${{ steps.r2gv.outputs.branch }}-macos.zip | |
asset_content_type: application/zip | |
- name: Upload zip | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist/artifacts/tarball/r2ghidra-${{ steps.r2gv.outputs.branch }}.zip | |
asset_name: r2ghidra-${{ steps.r2gv.outputs.branch }}.zip | |
asset_content_type: application/zip | |
- name: Upload tarball | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist/artifacts/tarball/r2ghidra-${{ steps.r2gv.outputs.branch }}.tar.xz | |
asset_name: r2ghidra-${{ steps.r2gv.outputs.branch }}.tar.xz | |
asset_content_type: application/x-txz | |
- name: Upload asset for Windows (w64) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist/artifacts/w64/r2ghidra-w64.zip | |
asset_name: r2ghidra-${{ steps.r2gv.outputs.branch }}-w64.zip | |
asset_content_type: application/zip | |
- name: Upload asset for Sleigh files | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist/artifacts/linux-acr-ok/r2ghidra_sleigh-${{ steps.r2gv.outputs.branch }}.zip | |
asset_name: r2ghidra_sleigh-${{ steps.r2gv.outputs.branch }}.zip | |
asset_content_type: application/zip |