From 9f12f069ee5fe1ba622f1a040366a3caed6292f9 Mon Sep 17 00:00:00 2001 From: Moritz Date: Wed, 27 Apr 2022 15:09:58 +0200 Subject: [PATCH] ci: fix build (#980) * ci: fix build * fix: newest PyInstaller version * fix: logo path * fix: logo path 2 * fix: logo path 3 * fix: icon another way * fix: remove icon for now * ci: only build after tests succeed * ci: add workflow_run check --- .github/pyinstaller/pyinstaller.spec | 2 +- .github/workflows/build.yml | 18 +++++++++++------- setup.py | 3 +++ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/pyinstaller/pyinstaller.spec b/.github/pyinstaller/pyinstaller.spec index 6d0854a9..f1c4fb1b 100644 --- a/.github/pyinstaller/pyinstaller.spec +++ b/.github/pyinstaller/pyinstaller.spec @@ -95,7 +95,7 @@ exe = EXE(pyz, a.datas, exclude_binaries=False, name='capa', - icon='logo.ico', + # TODO not working anymore for unknown reason icon='logo.ico', debug=False, strip=None, upx=True, diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ef58012..0d85fdce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,16 +1,22 @@ name: build on: - push: - branches: [master] + workflow_run: + workflows: [CI] + types: + - completed release: types: [edited, published] jobs: build: + # only build on release or if tests pass + if: ${{ github.event_name == 'release' }} || ${{ github.event.workflow_run.conclusion == 'success' }} name: PyInstaller for ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: + # set to false for debugging + fail-fast: true matrix: include: - os: ubuntu-18.04 @@ -37,12 +43,10 @@ jobs: run: sudo apt-get install -y libyaml-dev - name: Upgrade pip, setuptools run: pip install --upgrade pip setuptools - - name: Install PyInstaller - run: pip install 'pyinstaller==4.10' - - name: Install capa - run: pip install -e . + - name: Install capa with build requirements + run: pip install -e .[build] - name: Build standalone executable - run: pyinstaller .github/pyinstaller/pyinstaller.spec + run: pyinstaller --log-level DEBUG .github/pyinstaller/pyinstaller.spec - name: Does it run (PE)? run: dist/capa "tests/data/Practical Malware Analysis Lab 01-01.dll_" - name: Does it run (Shellcode)? diff --git a/setup.py b/setup.py index db9f5381..29e3acf1 100644 --- a/setup.py +++ b/setup.py @@ -88,6 +88,9 @@ setuptools.setup( "types-psutil==5.8.22", "types_requests==2.27.20", ], + "build": [ + "pyinstaller==5.0", + ], }, zip_safe=False, keywords="capa malware analysis capability detection FLARE",