Skip to content

Ghidra 11.2 issues

Ghidra 11.2 issues #36

Workflow file for this run

name: Test Generation Code
on:
pull_request:
push:
branches:
- master
workflow_dispatch:
inputs:
workflow-ghidra-ver:
description: "Specify Ghidra Version to Build"
required: true
type: string
default: "latest"
jobs:
set-versions:
runs-on: ubuntu-20.04
outputs:
ghidra-ver: ${{ env.GHIDRA_VER }}
pyi-ver: ${{ env.PYI_VER }}
pyi-rel-ver: ${{ env.PYI_REL_VER }}
steps:
- name: Get Latest Ghidra Version
id: get_latest_ghidra_ver
uses: pozetroninc/github-action-get-latest-release@v0.7.0
with:
repository: NationalSecurityAgency/ghidra
excludes: prerelease, draft
- name: Set Ghidra Version from Latest
id: format_ghidra_ver
run: |
echo "GHIDRA_VER=$(echo ${{steps.get_latest_ghidra_ver.outputs.release}} | cut -d_ -f2)" >> $GITHUB_ENV
- name: Set Ghidra Version from Input
if: github.event_name == 'workflow_dispatch' && github.event.inputs.workflow-ghidra-ver != 'latest'
run: |
echo "GHIDRA_VER=$(echo ${{github.event.inputs.workflow-ghidra-ver}})" >> $GITHUB_ENV
- name: Checkout repo
uses: actions/checkout@v3
- name: Get Ghidra Stubs Version
id: get_pyi_ver
run: |
echo "PYI_VER=$(python version.py)" >> $GITHUB_ENV
- name: Get Ghidra Stubs Full Release Version
id: get_pyi_rel_ver
run: |
echo "PYI_REL_VER=$GHIDRA_VER.$PYI_VER" >> $GITHUB_ENV
build:
needs:
- set-versions
name: Build and publish Python Package
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up JDK 1.11
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "11"
- uses: er28-0652/setup-ghidra@master
with:
version: "${{ needs.set-versions.outputs.ghidra-ver }}"
- name: Prepare Jython Environment
run: |
mkdir -p "$GHIDRA_INSTALL_DIR/Ghidra/Features/Python/data/jython-2.7.2/Lib/site-packages"
cp -r vendor/* "$GHIDRA_INSTALL_DIR/Ghidra/Features/Python/data/jython-2.7.2/Lib/site-packages/"
mkdir -p "$GHIDRA_INSTALL_DIR/Ghidra/Features/Python/data/jython-2.7.3/Lib/site-packages"
cp -r vendor/* "$GHIDRA_INSTALL_DIR/Ghidra/Features/Python/data/jython-2.7.3/Lib/site-packages/"
mkdir -p "$GHIDRA_INSTALL_DIR/Ghidra/Features/Ghidra/Features/Jython/lib/Lib/site-packages"
cp -r vendor/* "$GHIDRA_INSTALL_DIR/Ghidra/Features/Jython/lib/Lib/site-packages/"
- name: Build Package
run: |
"$GHIDRA_INSTALL_DIR/support/analyzeHeadless" /tmp tmp -scriptPath $(pwd) -preScript generate_ghidra_pyi.py ./ ${{ needs.set-versions.outputs.pyi-ver }}
test -f setup.py # check manually, because analyzeHeadless doesn't fail on script failure
test -d ghidra-stubs
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install pypa/build
run: >-
python -m
pip install
wheel
--user
- name: Build a binary wheel and a source tarball
run: |
python setup.py bdist_wheel --universal
python setup.py sdist
- name: Upload dist as artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist