Merge branch 'develop'
This commit is contained in:
12
.github/workflows/build.yml
vendored
12
.github/workflows/build.yml
vendored
@@ -2,6 +2,8 @@ name: build
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
|
|
||||||
@@ -36,7 +38,7 @@ jobs:
|
|||||||
build-ubuntu:
|
build-ubuntu:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
tag: [focal, groovy]
|
tag: [focal, hirsute, impish, jammy]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@@ -59,7 +61,7 @@ jobs:
|
|||||||
build-debian:
|
build-debian:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
tag: [buster, bullseye]
|
tag: [bullseye, bookworm]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@@ -93,6 +95,8 @@ jobs:
|
|||||||
files: |
|
files: |
|
||||||
gotify-tray-installer-win.exe
|
gotify-tray-installer-win.exe
|
||||||
gotify-tray_amd64_ubuntu_focal.deb
|
gotify-tray_amd64_ubuntu_focal.deb
|
||||||
gotify-tray_amd64_ubuntu_groovy.deb
|
gotify-tray_amd64_ubuntu_hirsute.deb
|
||||||
gotify-tray_amd64_debian_buster.deb
|
gotify-tray_amd64_ubuntu_impish.deb
|
||||||
|
gotify-tray_amd64_ubuntu_jammy.deb
|
||||||
gotify-tray_amd64_debian_bullseye.deb
|
gotify-tray_amd64_debian_bullseye.deb
|
||||||
|
gotify-tray_amd64_debian_bookworm.deb
|
||||||
|
|||||||
57
.github/workflows/develop.yml
vendored
Normal file
57
.github/workflows/develop.yml
vendored
Normal file
@@ -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
|
||||||
@@ -16,11 +16,11 @@ DEFAULT_SETTINGS = {
|
|||||||
"tray/notifications/icon/show": True,
|
"tray/notifications/icon/show": True,
|
||||||
"watchdog/interval/s": 60,
|
"watchdog/interval/s": 60,
|
||||||
"MessageWidget/image/size": 33,
|
"MessageWidget/image/size": 33,
|
||||||
"MessageWidget/font/title": "Noto Sans,12,-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": "Noto Sans,11,-1,5,50,1,0,0,0,0,Italic",
|
"MessageWidget/font/date": "Helvetica,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",
|
"MessageWidget/font/message": "Helvetica,12,-1,5,50,0,0,0,0,0,Regular",
|
||||||
"ApplicationItem/font": "Noto Sans,10,-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": "Noto Sans,13,-1,5,75,0,0,0,0,0,Bold",
|
"MainWindow/font/application": "Helvetica,14,-1,5,75,0,0,0,0,0,Bold",
|
||||||
"MainWindow/label/size": 25,
|
"MainWindow/label/size": 25,
|
||||||
"MainWindow/button/size": 33,
|
"MainWindow/button/size": 33,
|
||||||
"MainWindow/application/icon/size": 40,
|
"MainWindow/application/icon/size": 40,
|
||||||
|
|||||||
@@ -113,13 +113,17 @@ class GotifyClient(GotifySession):
|
|||||||
|
|
||||||
def upload_application_image(
|
def upload_application_image(
|
||||||
self, application_id: int, img_path: str
|
self, application_id: int, img_path: str
|
||||||
) -> Optional[GotifyApplicationModel]:
|
) -> Optional[Union[GotifyApplicationModel, GotifyErrorModel]]:
|
||||||
try:
|
try:
|
||||||
with open(img_path, "rb") as f:
|
with open(img_path, "rb") as f:
|
||||||
response = self._post(
|
response = self._post(
|
||||||
f"/application/{application_id}/image", files={"file": f}
|
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:
|
except FileNotFoundError:
|
||||||
logger.error(
|
logger.error(
|
||||||
f"GotifyClient.upload_application_image: image '{img_path}' not found."
|
f"GotifyClient.upload_application_image: image '{img_path}' not found."
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -15,7 +15,7 @@ with open("version.txt", "r") as f:
|
|||||||
|
|
||||||
# What packages are required for this module to be executed?
|
# What packages are required for this module to be executed?
|
||||||
REQUIRED = [
|
REQUIRED = [
|
||||||
'requests', 'PyQt6', 'websocket-client'
|
'requests', 'PyQt6', 'websocket-client', 'python-dateutil'
|
||||||
]
|
]
|
||||||
|
|
||||||
# What packages are optional?
|
# What packages are optional?
|
||||||
|
|||||||
Reference in New Issue
Block a user