From fd1886caff685bfbdec2cad322a11d9cc8bab932 Mon Sep 17 00:00:00 2001 From: Tom Wardill Date: Wed, 3 Apr 2024 15:25:24 +0100 Subject: [PATCH 1/7] Build windows binary using Github Actions --- .github/workflows/pull-request.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/pull-request.yml diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..f3ef998 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,18 @@ +name: Hello World + +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] + +jobs: + build: + runs-on: [windows-latest] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Hello World + run: echo "Hello, World!" From 1c38f331bde7523113db0d4f7f731fb146879946 Mon Sep 17 00:00:00 2001 From: Tom Wardill Date: Wed, 3 Apr 2024 15:37:06 +0100 Subject: [PATCH 2/7] Install python dependencies --- .github/workflows/pull-request.yml | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index f3ef998..0fd5f35 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,4 +1,4 @@ -name: Hello World +name: Build on: push: @@ -11,8 +11,32 @@ jobs: runs-on: [windows-latest] steps: + + - name: Checkout horusdemodlib + uses: actions/checkout@v4 + with: + repository: "projecthorus/horusdemodlib" + ref: "master" + path: "horusdemodlib" + + - name: Build horusdemodlib + run: | + cd horusdemodlib + mkdir build + cd build + cmake .. -G "MinGW Makefiles" + mingw32-make + - name: Checkout code uses: actions/checkout@v4 - - name: Hello World - run: echo "Hello, World!" + - uses: actions/setup-python@v5 + with: + python-version: '3.7' + cache: 'pip' # caching pip dependencies + + - name: Install pyAudio wheel + run: pip install https://download.lfd.uci.edu/pythonlibs/archived/cp37/PyAudio-0.2.11-cp37-cp37m-win_amd64.whl + + - name: Install other dependencies + run: pip install -r requirements.txt From c9a208e700fbd568078cb5a510fa619156485679 Mon Sep 17 00:00:00 2001 From: Tom Wardill Date: Wed, 3 Apr 2024 15:46:00 +0100 Subject: [PATCH 3/7] PyInstaller steps --- .github/workflows/pull-request.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 0fd5f35..58892a2 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -12,6 +12,9 @@ jobs: steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Checkout horusdemodlib uses: actions/checkout@v4 with: @@ -27,9 +30,6 @@ jobs: cmake .. -G "MinGW Makefiles" mingw32-make - - name: Checkout code - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 with: python-version: '3.7' @@ -40,3 +40,18 @@ jobs: - name: Install other dependencies run: pip install -r requirements.txt + + - name: Install pyinstaller + run: pip install pyinstaller + + - name: Prep file locations + shell: bash + run: | + mkdir -p dist + cp horusdemodlib/build/src/libhorus.dll . + cp "C:\Program Files\Git\mingw64\bin\libgcc_s_seh-1.dll" . + cp "C:\Program Files\Git\mingw64\bin\libstdc++-6.dll" . + cp "C:\Program Files\Git\mingw64\bin\libwinpthread-1.dll" . + + - name: Run pyinstaller + run: pyinstaller horus-gui_win.spec From e8e0e210ade1c4263f491b303116e4c41bb64e62 Mon Sep 17 00:00:00 2001 From: Tom Wardill Date: Wed, 3 Apr 2024 16:10:05 +0100 Subject: [PATCH 4/7] Add artifact upload --- .github/workflows/pull-request.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 58892a2..89f56e8 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -55,3 +55,10 @@ jobs: - name: Run pyinstaller run: pyinstaller horus-gui_win.spec + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: built-executable + path: dist/horus-gui.exe + retention-days: 2 From b364e842f0bf448d092219e654369a73fcc9327a Mon Sep 17 00:00:00 2001 From: Tom Wardill Date: Thu, 4 Apr 2024 09:40:01 +0100 Subject: [PATCH 5/7] Use python 3.11 Install pyaudio directly from pip now. --- .github/workflows/pull-request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 89f56e8..65c7e24 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -32,11 +32,11 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: '3.7' + python-version: '3.11' cache: 'pip' # caching pip dependencies - name: Install pyAudio wheel - run: pip install https://download.lfd.uci.edu/pythonlibs/archived/cp37/PyAudio-0.2.11-cp37-cp37m-win_amd64.whl + run: pip install pyAudio - name: Install other dependencies run: pip install -r requirements.txt From e92264923be09472c3bd4d684897093c006329bc Mon Sep 17 00:00:00 2001 From: Tom Wardill Date: Thu, 4 Apr 2024 09:42:20 +0100 Subject: [PATCH 6/7] Fix capitalisation pyAudio != pyaudio --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 65c7e24..b086706 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -36,7 +36,7 @@ jobs: cache: 'pip' # caching pip dependencies - name: Install pyAudio wheel - run: pip install pyAudio + run: pip install pyaudio - name: Install other dependencies run: pip install -r requirements.txt From 608f0897a3cfbe470e0354ae428c8e9336b96f0f Mon Sep 17 00:00:00 2001 From: Tom Wardill Date: Thu, 4 Apr 2024 09:47:17 +0100 Subject: [PATCH 7/7] Fix generated filename This is a zip file, so it should have a zip extension --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index b086706..d55f85a 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -59,6 +59,6 @@ jobs: - name: Upload Artifact uses: actions/upload-artifact@v4 with: - name: built-executable + name: horus-gui.zip path: dist/horus-gui.exe retention-days: 2