Skip to content

Commit

Permalink
[ALL] Add pyinstaller
Browse files Browse the repository at this point in the history
  • Loading branch information
Sobottasgithub committed Mar 21, 2024
1 parent fd2a673 commit d97e43e
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 103 deletions.
95 changes: 0 additions & 95 deletions .github/workflows/pyinstaller-LogViewer.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Build
on:
push:
tags:
- 'MCA-v*' # Push events to matching v*, i.e. v1.0, v20.15.10
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
workflow_dispatch:

jobs:
Expand All @@ -17,6 +17,39 @@ jobs:
strategy:
matrix:
include:
# LogViewer
- os: macos-latest
TARGET: macos
#--volicon "Hello World.icns" \
# for the dmg stuff, see https://www.pythonguis.com/tutorials/packaging-pyqt5-applications-pyinstaller-macos-dmg/
CMD_BUILD: >
pyinstaller --clean --log-level DEBUG --name "LogViewer" --add-data "LogViewer/data:LogViewer/data" --add-data "shared/ui/*.ui:shared/ui" --add-data "LogViewer/ui/*.ui:LogViewer/ui" --specpath src --windowed --icon LogViewer/data/art/icon.png --onefile --debug bootloader --argv-emulation src/LogViewer.py &&
cd dist/ &&
zip -r9 LogViewer LogViewer.app/ &&
brew install create-dmg &&
mkdir -p dmg &&
cp -vr "LogViewer.app" dmg/ &&
create-dmg --volname "LogViewer" --volicon LogViewer.app/Contents/Resources/generated-* --window-pos 200 120 --window-size 600 300 --icon-size 100 --icon "LogViewer.app" 175 120 --hide-extension "LogViewer.app" --app-drop-link 425 120 "LogViewer.dmg" "./dmg/"
OUT_FILE_NAME: LogViewer.dmg
ASSET_MIME: application/binary
- os: windows-latest
TARGET: windows
CMD_BUILD: >
pyinstaller --clean --log-level DEBUG --name "LogViewer" --add-data "LogViewer/data;LogViewer/data" --add-data "shared/ui/*.ui;shared/ui" --add-data "LogViewer/ui/*.ui;LogViewer/ui" --specpath src --windowed --icon LogViewer/data/art/icon.png --onefile --debug bootloader src/LogViewer.py
OUT_FILE_NAME: LogViewer.exe
ASSET_MIME: application/vnd.microsoft.portable-executable
- os: ubuntu-latest
TARGET: linux
#sudo apt install plasma-integration -y &&
#sudo cp -av /usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes/KDEPlasmaPlatformTheme.so /opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/PyQt5/Qt5/plugins/platformthemes/ -f &&
#--add-binary "/usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes/KDEPlasmaPlatformTheme.so:PyQt5/Qt5/plugins/platformthemes"
#--add-binary "/lib/x86_64-linux-gnu/libz.so.1:."
CMD_BUILD: >
pyinstaller --clean --log-level DEBUG --name "LogViewer" --add-data "LogViewer/data:LogViewer/data" --add-data "shared/ui/*.ui:shared/ui" --add-data "LogViewer/ui/*.ui:LogViewer/ui" --specpath src --windowed --icon LogViewer/data/art/icon.png --onefile src/LogViewer.py
OUT_FILE_NAME: LogViewer
ASSET_MIME: application/x-executable

# CrashAnalyzer
- os: macos-latest
TARGET: macos
#--volicon "Hello World.icns" \
Expand Down Expand Up @@ -64,7 +97,7 @@ jobs:
pip install --upgrade tcl
pip install --upgrade -r src/requirements.txt
- name: Extract version string
run: echo "VERSION='${{ github.ref_name }}'" >src/CrashAnalyzer/utils/version.py
run: echo "VERSION='${{ github.ref_name }}'" >src/shared/utils/version.py
- name: Build with pyinstaller for ${{matrix.TARGET}}
run: ${{matrix.CMD_BUILD}}
- uses: actions/upload-artifact@v3
Expand All @@ -89,6 +122,7 @@ jobs:
body: |
New release
files: |
LogViewer*/*
CrashAnalyzer*/*
fail_on_unmatched_files: true
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
3 changes: 1 addition & 2 deletions src/CrashAnalyzer/ui/main_window.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import functools
from PyQt5 import QtWidgets

from CrashAnalyzer.utils.version import VERSION
from shared.utils import catch_exceptions
from shared.ui.utils import UiAutoloader
import shared.ui.utils.helpers as sharedUiHelpers
Expand All @@ -23,7 +22,7 @@ def __init__(self):
self.uiList_parts.itemDoubleClicked.connect(self.export_part)
self.uiList_parts.currentItemChanged.connect(self.switch_part)
self.uiAction_close.triggered.connect(self.close)
self.uiAction_about.triggered.connect(functools.partial(sharedUiHelpers.action_about, VERSION))
self.uiAction_about.triggered.connect(sharedUiHelpers.action_about)

@catch_exceptions(logger=logger)
def close(self, _):
Expand Down
3 changes: 1 addition & 2 deletions src/LogViewer/ui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from LogViewer.storage import SettingsSingleton
from LogViewer.utils import Search, AbortSearch, QueryStatus, matchQuery
import LogViewer.utils.helpers as helpers
from LogViewer.utils.version import VERSION
from .utils import Completer, MagicLineEdit, Statusbar
from .preferences_dialog import PreferencesDialog
from shared.storage import Rawlog, AbortRawlogLoading
Expand Down Expand Up @@ -54,7 +53,7 @@ def __init__(self):
self.uiAction_export.triggered.connect(self.export)
self.uiAction_save.triggered.connect(self.save)
self.uiAction_inspectLine.triggered.connect(self.inspectLine)
self.uiAction_about.triggered.connect(functools.partial(sharedUiHelpers.action_about, VERSION))
self.uiAction_about.triggered.connect(sharedUiHelpers.action_about)
self.uiAction_pushStack.triggered.connect(self.pushStack)
self.uiAction_popStack.triggered.connect(self.popStack)
self.uiAction_goToRow.triggered.connect(self.openGoToRowWidget)
Expand Down
1 change: 0 additions & 1 deletion src/LogViewer/utils/version.py

This file was deleted.

3 changes: 2 additions & 1 deletion src/shared/ui/about_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

from shared.utils import catch_exceptions, Paths
from shared.ui.utils import UiAutoloader
from shared.utils.version import VERSION

import logging
logger = logging.getLogger(__name__)

@UiAutoloader
class AboutDialog(QtWidgets.QDialog):
@catch_exceptions(logger=logger)
def __init__(self, VERSION):
def __init__(self, *args):
self.uiLabel_version.setText(VERSION)
self.uiLabel_configDir.setText(Paths.user_data_dir())
self.uiLabel_loggerDir.setText(Paths.user_log_dir())
File renamed without changes.

0 comments on commit d97e43e

Please sign in to comment.