Skip to content

Commit

Permalink
Merge pull request #10 from digitalf0x/ft-ci-builds
Browse files Browse the repository at this point in the history
ci: Add GitHub Actions PyInstaller builder
  • Loading branch information
Z4urce authored Mar 29, 2024
2 parents 938e71b + 1af19f1 commit c467e05
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 2 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/build-pyinstaller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build with PyInstaller

# From https://github.com/sayyid5416/pyinstaller

on:
push:
pull_request:

# Get git tag info via GitHub API due to shallow clone:
# See https://github.com/marketplace/actions/gh-describe
# And https://stackoverflow.com/questions/66349002/get-latest-tag-git-describe-tags-when-repo-is-cloned-with-depth-1
# And https://dev.to/hectorleiva/github-actions-and-creating-a-short-sha-hash-8b7

jobs:
pyinstall-windows:
runs-on: windows-latest
steps:
- name: Git describe
id: ghd
uses: proudust/gh-describe@v2
with:
default: "notags-${{ github.sha }}"
- name: Check outputs
run: |
echo "describe : ${{ steps.ghd.outputs.describe }}"
echo "tag : ${{ steps.ghd.outputs.tag }}"
echo "distance : ${{ steps.ghd.outputs.distance }}"
echo "sha : ${{ steps.ghd.outputs.sha }}"
echo "short-sha : ${{ steps.ghd.outputs.short-sha }}"
- name: Build executable
uses: sayyid5416/pyinstaller@v1
with:
spec: 'hapticpancake.spec'
requirements: 'BridgeApp/requirements.txt'
upload_exe_with_name: 'hapticpancake_windows_${{ steps.ghd.outputs.describe }}'
# options: --onefile, --windowed, --collect-all openvr, --name "hapticpancake", --icon=Images\icon.ico
# These options are not used when passing in a .spec file

pyinstall-linux:
runs-on: ubuntu-latest
steps:
- name: Git describe
id: ghd
uses: proudust/gh-describe@v2
with:
default: "notags-${{ github.sha }}"
- name: Check outputs
run: |
echo "describe : ${{ steps.ghd.outputs.describe }}"
echo "tag : ${{ steps.ghd.outputs.tag }}"
echo "distance : ${{ steps.ghd.outputs.distance }}"
echo "sha : ${{ steps.ghd.outputs.sha }}"
echo "short-sha : ${{ steps.ghd.outputs.short-sha }}"
- name: Build executable
uses: sayyid5416/pyinstaller@v1
with:
spec: 'hapticpancake.spec'
requirements: 'BridgeApp/requirements.txt'
upload_exe_with_name: 'hapticpancake_linux_${{ steps.ghd.outputs.describe }}'
# options: --onefile, --windowed, --collect-all openvr, --name "hapticpancake", --icon=Images\icon.ico
# These options are not used when passing in a .spec file
4 changes: 2 additions & 2 deletions hapticpancake.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]


a = Analysis(
['BridgeApp\\main.py'],
['BridgeApp/main.py'],
pathex=[],
binaries=binaries,
datas=datas,
Expand Down Expand Up @@ -41,5 +41,5 @@ exe = EXE(
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=['Images\\icon.ico'],
icon=['Images/icon.ico'],
)

0 comments on commit c467e05

Please sign in to comment.