-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add build system for modern OS versions (#8)
* Modernise deps and build system * Builds * Builds * Builds * Builds * Bump to py 3.12 * Use spec files * Dir * Dir * Fix pathing * Try plisting * Try plisting * Try plisting * Try onefile * Try py2app * Try py2app * Pyinstaller w/ tar * Pyinstaller w/ tar * Pyinstaller w/ tar * Pyinstaller w/ tar * Onedir, not onefile * Cleanup * Cleanup * Fix file dialogs, cleanup
- Loading branch information
1 parent
6a2fbba
commit 5808424
Showing
6 changed files
with
207 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Build | ||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
strategy: | ||
matrix: | ||
os: [ macos-13, windows-latest ] | ||
include: | ||
- os: macos-13 | ||
spec: build_macos.spec | ||
package_name: macos-binary | ||
- os: windows-latest | ||
spec: build_windows.spec | ||
package_name: windows-binary | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
cache: 'pip' | ||
- name: Install deps | ||
run: | | ||
python -m pip install setuptools wheel pyinstaller | ||
python -m pip install -r requirements.txt | ||
python -m pip list | ||
- name: Create Executable | ||
run: pyinstaller ${{ matrix.spec }} | ||
- name: Compress Executable | ||
if: matrix.os == 'macos-13' | ||
working-directory: ./dist | ||
run: | | ||
tar -zcvf QuantiFish.tar.gz QuantiFish.app | ||
- name: Artifact upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.package_name }} | ||
path: | | ||
dist/QuantiFish.exe | ||
dist/QuantiFish.tar.gz | ||
retention-days: 30 | ||
- name: Create release | ||
if: startsWith(github.ref, 'refs/tags') | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
./dist/*.exe | ||
./dist/*.app | ||
draft: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# -*- mode: python ; coding: utf-8 -*- | ||
|
||
a = Analysis( | ||
['QuantiFish.py'], | ||
pathex=[], | ||
binaries=[], | ||
datas=[('resources', 'resources')], | ||
hiddenimports=[], | ||
hookspath=[], | ||
hooksconfig={}, | ||
runtime_hooks=[], | ||
excludes=[], | ||
noarchive=False, | ||
optimize=0, | ||
) | ||
|
||
pyz = PYZ(a.pure) | ||
|
||
exe = EXE( | ||
pyz, | ||
a.scripts, | ||
[], | ||
exclude_binaries=True, | ||
name='QuantiFish', | ||
debug=False, | ||
bootloader_ignore_signals=False, | ||
strip=False, | ||
upx=True, | ||
console=False, | ||
disable_windowed_traceback=False, | ||
argv_emulation=False, | ||
target_arch=None, | ||
codesign_identity=None, | ||
icon=['resources/QFIcon.icns'], | ||
) | ||
|
||
coll = COLLECT( | ||
exe, | ||
a.binaries, | ||
a.datas, | ||
strip=False, | ||
upx=True, | ||
upx_exclude=[], | ||
name='QuantiFish', | ||
) | ||
|
||
app = BUNDLE( | ||
coll, | ||
name='QuantiFish.app', | ||
icon='resources/QFIcon.icns', | ||
info_plist={ | ||
'CFBundleVersion': '2.1.2', | ||
'CFBundleShortVersionString': '2.1.2', | ||
'NSPrincipalClass': 'NSApplication', | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# -*- mode: python ; coding: utf-8 -*- | ||
|
||
|
||
a = Analysis( | ||
['QuantiFish.py'], | ||
pathex=[], | ||
binaries=[], | ||
datas=[('resources', 'resources')], | ||
hiddenimports=[], | ||
hookspath=[], | ||
hooksconfig={}, | ||
runtime_hooks=[], | ||
excludes=[], | ||
noarchive=False, | ||
optimize=0, | ||
) | ||
pyz = PYZ(a.pure) | ||
|
||
exe = EXE( | ||
pyz, | ||
a.scripts, | ||
a.binaries, | ||
a.datas, | ||
[], | ||
name='quantifish', | ||
debug=False, | ||
bootloader_ignore_signals=False, | ||
strip=False, | ||
upx=True, | ||
upx_exclude=[], | ||
runtime_tmpdir=None, | ||
console=False, | ||
disable_windowed_traceback=False, | ||
argv_emulation=False, | ||
target_arch=None, | ||
codesign_identity=None, | ||
entitlements_file=None, | ||
icon=['resources/QFIcon.ico'], | ||
) | ||
app = BUNDLE( | ||
exe, | ||
name='QuantiFish.exe', | ||
icon='resources/QFIcon.ico', | ||
bundle_identifier=None, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from setuptools import setup | ||
import os | ||
|
||
if os.name == 'nt': | ||
OPTIONS = {} | ||
EXTRAS = [] | ||
else: | ||
OPTIONS = {'py2app': { | ||
'resources': './resources', | ||
'iconfile': f'./resources/QFIcon.icns' | ||
}} | ||
EXTRAS = ['py2app'] | ||
|
||
|
||
setup( | ||
app=['QuantiFish.py'], | ||
options=OPTIONS, | ||
setup_requires=EXTRAS, | ||
install_requires=["scikit-image", "scipy", "pillow", "numpy"], | ||
) |