From 44f753bcdce66f7b6accaf1bde16b0dfaf5c6706 Mon Sep 17 00:00:00 2001 From: beniroquai Date: Sat, 24 Sep 2022 18:03:16 +0200 Subject: [PATCH] Trying to autoupdate Pyinstaller files --- .github/workflows/imswitch-bundle.yml | 12 +++++++++--- README.md | 2 +- UC2REST | 2 +- imswitch/__init__.py | 2 +- .../imcommon/controller/CheckUpdatesController.py | 8 ++++++++ imswitch/imcommon/view/AboutDialog.py | 4 ++-- imswitch/imcommon/view/CheckUpdatesDialog.py | 2 +- setup.cfg | 2 +- 8 files changed, 24 insertions(+), 10 deletions(-) diff --git a/.github/workflows/imswitch-bundle.yml b/.github/workflows/imswitch-bundle.yml index 89791f4b5..ca2f39583 100644 --- a/.github/workflows/imswitch-bundle.yml +++ b/.github/workflows/imswitch-bundle.yml @@ -1,14 +1,12 @@ name: imswitch-bundle on: - workflow_dispatch: push: tags: - - '*' + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 jobs: build: - runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -32,6 +30,14 @@ jobs: - name: Build bundle run: | pyinstaller imswitch.spec + cd dist + cd ImSwitch + dir + - name: Upload updated .exe + uses: actions/upload-artifact@v2 + with: + name: imswitch-${{ matrix.os }} + path: dist/ImSwitch/ImSwitch.exe - name: Upload artifact uses: actions/upload-artifact@v2 with: diff --git a/README.md b/README.md index a20d8c059..70ece9dfd 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ that it is possible to integrate current state-of-the-art solutions into one uni ### Option A: Standalone bundles for Windows -Windows users can download ImSwitch in standalone format from the [releases page on GitHub](https://github.com/kasasxav/ImSwitch/releases). Further information is available there. An existing Python installation is *not* required. +Windows users can download ImSwitch in standalone format from the [releases page on GitHub](https://github.com/openUC2/ImSwitch/releases). Further information is available there. An existing Python installation is *not* required. ### Option B: Install using pip diff --git a/UC2REST b/UC2REST index e9e9a3b69..27318aa6e 160000 --- a/UC2REST +++ b/UC2REST @@ -1 +1 @@ -Subproject commit e9e9a3b69811be39ae928faa7629bf30b5362e2c +Subproject commit 27318aa6e3b05586616635c4a514cdafe5e928fc diff --git a/imswitch/__init__.py b/imswitch/__init__.py index ee9091e19..22ffa7b85 100644 --- a/imswitch/__init__.py +++ b/imswitch/__init__.py @@ -1,4 +1,4 @@ -__version__ = '1.2.1' +__version__ = '1.2.2' # Copyright (C) 2020-2021 ImSwitch developers diff --git a/imswitch/imcommon/controller/CheckUpdatesController.py b/imswitch/imcommon/controller/CheckUpdatesController.py index e07d920de..396cf0c0c 100644 --- a/imswitch/imcommon/controller/CheckUpdatesController.py +++ b/imswitch/imcommon/controller/CheckUpdatesController.py @@ -4,6 +4,8 @@ import requests from luddite import get_version_pypi from packaging import version +import subprocess + import imswitch from imswitch.imcommon.framework import Signal, Thread @@ -58,6 +60,8 @@ def run(self): 'https://api.github.com/repos/openUC2/ImSwitch/releases/latest' ) latestVersion = releaseResponse.json()['tag_name'].lstrip('v') + latestVersionDate = releaseResponse.json()['published_at'].split('T')[0] + if version.parse(latestVersion) > version.parse(currentVersion): self.sigNewVersionPyInstaller.emit(latestVersion) else: @@ -72,6 +76,10 @@ def run(self): except Exception: self.__logger.warning(traceback.format_exc()) self.sigFailed.emit() + + def getCurrentCommitDate(self): + return str(subprocess.check_output(['git', 'log', '-n', '1', '--pretty=tformat:%h-%ad', '--date=short']).strip()).split("-")[-3:] + # Copyright (C) 2020-2021 ImSwitch developers diff --git a/imswitch/imcommon/view/AboutDialog.py b/imswitch/imcommon/view/AboutDialog.py index 315bdeb99..e27ded397 100644 --- a/imswitch/imcommon/view/AboutDialog.py +++ b/imswitch/imcommon/view/AboutDialog.py @@ -15,8 +15,8 @@ def __init__(self, parent=None, *args, **kwargs): self.label = QtWidgets.QLabel( f'ImSwitch {imswitch.__version__}' f'

Code available at: ' - f'' - f'https://github.com/kasasxav/ImSwitch' + f'' + f'https://github.com/openUC2/ImSwitch' f'' f'
Licensed under the GNU General Public License v3.0.' ) diff --git a/imswitch/imcommon/view/CheckUpdatesDialog.py b/imswitch/imcommon/view/CheckUpdatesDialog.py index 209426ea3..7727b944f 100644 --- a/imswitch/imcommon/view/CheckUpdatesDialog.py +++ b/imswitch/imcommon/view/CheckUpdatesDialog.py @@ -63,7 +63,7 @@ def showPyInstallerUpdate(self, newVersion): ) self.linkLabel.setText( 'The new version may be downloaded from ' - '' + '' 'the GitHub releases page' '' '.' diff --git a/setup.cfg b/setup.cfg index d0f17a36b..3f549c0bb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,7 +6,7 @@ author_email = benedictdied@gmail.com description = Microscopy control long_description = file: README.md long_description_content_type = text/markdown -url = https://github.com/kasasxav/ImSwitch +url = https://github.com/openUC2/ImSwitch project_urls = Bug Tracker = https://github.com/openUC2/ImSwitch/issues classifiers =