From 690da1b83c8e94e9385875f4728c96e5da2f5ea3 Mon Sep 17 00:00:00 2001 From: "dries.k" Date: Thu, 21 Jul 2022 10:46:06 +0200 Subject: [PATCH 1/5] more build targets --- .github/workflows/build.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b70fa4e..4580aed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,7 +36,7 @@ jobs: build-ubuntu: strategy: matrix: - tag: [focal, groovy] + tag: [focal, hirsute, impish, jammy] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -59,7 +59,7 @@ jobs: build-debian: strategy: matrix: - tag: [buster, bullseye] + tag: [bullseye, bookworm] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -93,6 +93,8 @@ jobs: files: | gotify-tray-installer-win.exe gotify-tray_amd64_ubuntu_focal.deb - gotify-tray_amd64_ubuntu_groovy.deb - gotify-tray_amd64_debian_buster.deb + gotify-tray_amd64_ubuntu_hirsute.deb + gotify-tray_amd64_ubuntu_impish.deb + gotify-tray_amd64_ubuntu_jammy.deb gotify-tray_amd64_debian_bullseye.deb + gotify-tray_amd64_debian_bookworm.deb From 1aa324eebfc73919e679af7229afe3afcf32f691 Mon Sep 17 00:00:00 2001 From: "dries.k" Date: Thu, 21 Jul 2022 10:49:46 +0200 Subject: [PATCH 2/5] add python-dateutil requirement to setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a5f490f..a11ee3e 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ with open("version.txt", "r") as f: # What packages are required for this module to be executed? REQUIRED = [ - 'requests', 'PyQt6', 'websocket-client' + 'requests', 'PyQt6', 'websocket-client', 'python-dateutil' ] # What packages are optional? From a7b1f2064b453e5554677f5ca13f7724402543f8 Mon Sep 17 00:00:00 2001 From: "dries.k" Date: Thu, 21 Jul 2022 10:50:10 +0200 Subject: [PATCH 3/5] return GotifyErrorModel in upload_application_image --- gotify_tray/gotify/api.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gotify_tray/gotify/api.py b/gotify_tray/gotify/api.py index 432ca19..c7b53f2 100644 --- a/gotify_tray/gotify/api.py +++ b/gotify_tray/gotify/api.py @@ -113,13 +113,17 @@ class GotifyClient(GotifySession): def upload_application_image( self, application_id: int, img_path: str - ) -> Optional[GotifyApplicationModel]: + ) -> Optional[Union[GotifyApplicationModel, GotifyErrorModel]]: try: with open(img_path, "rb") as f: response = self._post( f"/application/{application_id}/image", files={"file": f} ) - return response.json() if response.ok else None + return ( + GotifyApplicationModel(response.json()) + if response.ok + else GotifyErrorModel(response) + ) except FileNotFoundError: logger.error( f"GotifyClient.upload_application_image: image '{img_path}' not found." From ad4e3daa30da34277eba9d28982cee5b07cd8155 Mon Sep 17 00:00:00 2001 From: "dries.k" Date: Thu, 21 Jul 2022 14:51:52 +0200 Subject: [PATCH 4/5] change default fonts to helvetica --- gotify_tray/database/default_settings.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gotify_tray/database/default_settings.py b/gotify_tray/database/default_settings.py index 4376c1b..58bb0ea 100644 --- a/gotify_tray/database/default_settings.py +++ b/gotify_tray/database/default_settings.py @@ -16,11 +16,11 @@ DEFAULT_SETTINGS = { "tray/notifications/icon/show": True, "watchdog/interval/s": 60, "MessageWidget/image/size": 33, - "MessageWidget/font/title": "Noto Sans,12,-1,5,75,0,0,0,0,0,Bold", - "MessageWidget/font/date": "Noto Sans,11,-1,5,50,1,0,0,0,0,Italic", - "MessageWidget/font/message": "Noto Sans,11,-1,5,50,0,0,0,0,0,Regular", - "ApplicationItem/font": "Noto Sans,10,-1,5,50,0,0,0,0,0,Regular", - "MainWindow/font/application": "Noto Sans,13,-1,5,75,0,0,0,0,0,Bold", + "MessageWidget/font/title": "Helvetica,13,-1,5,75,0,0,0,0,0,Bold", + "MessageWidget/font/date": "Helvetica,11,-1,5,50,1,0,0,0,0,Italic", + "MessageWidget/font/message": "Helvetica,12,-1,5,50,0,0,0,0,0,Regular", + "ApplicationItem/font": "Helvetica,12,-1,5,50,0,0,0,0,0,Regular", + "MainWindow/font/application": "Helvetica,14,-1,5,75,0,0,0,0,0,Bold", "MainWindow/label/size": 25, "MainWindow/button/size": 33, "MainWindow/application/icon/size": 40, From 84e673043f648b244af174e8949c15d2c20b3e5f Mon Sep 17 00:00:00 2001 From: "dries.k" Date: Thu, 21 Jul 2022 14:59:14 +0200 Subject: [PATCH 5/5] add develop workflow --- .github/workflows/build.yml | 2 ++ .github/workflows/develop.yml | 57 +++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 .github/workflows/develop.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4580aed..95f52ef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,8 @@ name: build on: push: + branches: + - master tags: - '*' diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml new file mode 100644 index 0000000..337b2c3 --- /dev/null +++ b/.github/workflows/develop.yml @@ -0,0 +1,57 @@ +name: build + +on: + push: + branches: + - '!master' + +jobs: + + build-win64: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: '3.9.5' + - name: Upgrade pip and enable wheel support + run: python -m pip install --upgrade pip setuptools wheel + - name: Install Requirements + run: | + pip install -r requirements.txt + pip install pyinstaller + shell: bash + - name: Build + run: | + powershell -File build-win.ps1 + mv inno-output\gotify-tray-installer.exe gotify-tray-installer-win.exe + shell: cmd + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: gotify-tray-installer-win.exe + path: gotify-tray-installer-win.exe + + build-ubuntu: + strategy: + matrix: + tag: [focal] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.9.5' + - name: Upgrade pip and enable wheel support + run: python -m pip install --upgrade pip setuptools wheel + - name: Build + run: | + make build + cp dist/gotify-tray_amd64.deb gotify-tray_amd64_ubuntu_${{ matrix.tag }}.deb + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: gotify-tray_amd64_ubuntu_${{ matrix.tag }}.deb + path: gotify-tray_amd64_ubuntu_${{ matrix.tag }}.deb