From 30236345368daa93d4e495741593fa450b4f0cf9 Mon Sep 17 00:00:00 2001 From: Moritz Date: Tue, 13 Apr 2021 15:42:58 +0200 Subject: [PATCH] build using Py3.8 and test across more OSs (#506) * build using Py3.8 and test across more OSs * enable for release * test builds on push to master --- .github/workflows/build.yml | 45 ++++++++++++++++++++++++++++++++----- CHANGELOG.md | 2 ++ 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 35f47c51..1fe61c02 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,8 @@ name: build on: + push: + branches: [master] release: types: [edited, published] @@ -26,10 +28,11 @@ jobs: uses: actions/checkout@v2 with: submodules: true - - name: Set up Python 3.9 + # using Python 3.8 to support running across multiple operating systems including Windows 7 + - name: Set up Python 3.8 uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: 3.8 - if: matrix.os == 'ubuntu-16.04' run: sudo apt-get install -y libyaml-dev - name: Install PyInstaller @@ -45,10 +48,42 @@ jobs: name: ${{ matrix.asset_name }} path: dist/${{ matrix.artifact_name }} - zip: - name: zip ${{ matrix.asset_name }} + test_run: + # test that binaries run on push to master + if: github.event_name == 'push' + name: Test run on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + needs: [build] + strategy: + matrix: + include: + # OSs not already tested above + - os: ubuntu-18.04 + artifact_name: capa + asset_name: linux + - os: ubuntu-20.04 + artifact_name: capa + asset_name: linux + - os: windows-2016 + artifact_name: capa.exe + asset_name: windows + steps: + - name: Download ${{ matrix.asset_name }} + uses: actions/download-artifact@v2 + with: + name: ${{ matrix.asset_name }} + - name: Set executable flag + if: matrix.os != 'windows-2016' + run: chmod +x ${{ matrix.artifact_name }} + - name: Run capa + run: ./${{ matrix.artifact_name }} -h + + zip_and_upload: + # upload zipped binaries to Release page + if: github.event_name == 'release' + name: zip and upload ${{ matrix.asset_name }} runs-on: ubuntu-20.04 - needs: build + needs: [build] strategy: matrix: include: diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fe27a85..3505dbf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ The first Python 3 ONLY capa version. ### Bug Fixes +- build: use Python 3.8 for PyInstaller to support consistently running across multiple operating systems including Windows 7 #505 @mr-tz + ### Changes - py3: drop Python 2 support #480 @Ana06