diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b70fa4e..95f52ef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,8 @@ name: build on: push: + branches: + - master tags: - '*' @@ -36,7 +38,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 +61,7 @@ jobs: build-debian: strategy: matrix: - tag: [buster, bullseye] + tag: [bullseye, bookworm] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -93,6 +95,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 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 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, 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." 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?