diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 10410a3..45555de 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -36,7 +36,6 @@ jobs: path: gotify-tray-installer-win.exe build-ubuntu: - if: ${{ github.actor != 'dependabot[bot]' }} strategy: matrix: tag: [jammy] @@ -49,18 +48,24 @@ jobs: python-version: '3.10.8' - name: Upgrade pip and enable wheel support run: python -m pip install --upgrade pip setuptools wheel + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.0' - name: Build run: | - make build - cp dist/gotify-tray_amd64.deb gotify-tray_amd64_ubuntu_${{ matrix.tag }}.deb + pip install -r requirements.txt + pip install pyinstaller + gem install fpm + chmod +x build-linux.sh + ./build-linux.sh deb + mv "dist/gotify-tray_${{github.ref_name}}_amd64.deb" "gotify-tray_${{github.ref_name}}_amd64_${{ matrix.tag }}.deb" - name: Upload artifact uses: actions/upload-artifact@v3 with: - name: gotify-tray_amd64_ubuntu_${{ matrix.tag }}.deb - path: gotify-tray_amd64_ubuntu_${{ matrix.tag }}.deb + path: "gotify-tray_*_amd64_${{ matrix.tag }}.deb" + build-macos: - if: ${{ github.actor != 'dependabot[bot]' }} runs-on: macos-12 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6df3d0a..954d22b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,29 +33,6 @@ jobs: name: gotify-tray-installer-win.exe path: gotify-tray-installer-win.exe - build-ubuntu: - strategy: - matrix: - tag: [focal, jammy] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.10.8' - - 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@v3 - with: - name: gotify-tray_amd64_ubuntu_${{ matrix.tag }}.deb - path: gotify-tray_amd64_ubuntu_${{ matrix.tag }}.deb - build-debian: strategy: matrix: @@ -69,15 +46,22 @@ jobs: python-version: '3.10.8' - name: Upgrade pip and enable wheel support run: python -m pip install --upgrade pip setuptools wheel + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.0' - name: Build run: | - make build - cp dist/gotify-tray_amd64.deb gotify-tray_amd64_debian_${{ matrix.tag }}.deb + pip install -r requirements.txt + pip install pyinstaller + gem install fpm + chmod +x build-linux.sh + ./build-linux.sh deb + mv "dist/gotify-tray_$(cat version.txt)_amd64.deb" "gotify-tray_$(cat version.txt)_amd64_${{ matrix.tag }}.deb" - name: Upload artifact uses: actions/upload-artifact@v3 with: - name: gotify-tray_amd64_debian_${{ matrix.tag }}.deb - path: gotify-tray_amd64_debian_${{ matrix.tag }}.deb + name: gotify-tray_${{github.ref_name}}_amd64_${{ matrix.tag }}.deb + path: gotify-tray_${{github.ref_name}}_amd64_${{ matrix.tag }}.deb build-macos: runs-on: macos-12 @@ -102,6 +86,11 @@ jobs: pypi: runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/gotify-tray + permissions: + id-token: write steps: - uses: actions/checkout@v3 - name: Set up Python @@ -118,17 +107,15 @@ jobs: run: python -m build - name: upload to pypi uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_API_TOKEN }} - name: Upload artifact uses: actions/upload-artifact@v3 with: - name: gotify_tray-${{ github.ref_name }}-py3-none-any.whl - path: dist/gotify_tray-${{ github.ref_name }}-py3-none-any.whl + name: gotify_tray-${{github.ref_name}}-py3-none-any.whl + path: dist/gotify_tray-${{github.ref_name}}-py3-none-any.whl release: runs-on: ubuntu-latest - needs: [build-win64, build-ubuntu, build-debian, build-macos, pypi] + needs: [build-win64, build-debian, build-macos, pypi] steps: - uses: actions/checkout@v3 - uses: actions/download-artifact@v3 @@ -139,9 +126,7 @@ jobs: prerelease: false files: | gotify-tray-installer-win.exe - gotify-tray_amd64_ubuntu_focal.deb - gotify-tray_amd64_ubuntu_jammy.deb - gotify-tray_amd64_debian_bullseye.deb - gotify-tray_amd64_debian_bookworm.deb gotify-tray.dmg - gotify_tray-${{ github.ref_name }}-py3-none-any.whl + gotify-tray_${{github.ref_name}}_amd64_bullseye.deb + gotify-tray_${{github.ref_name}}_amd64_bookworm.deb + gotify_tray-${{github.ref_name}}-py3-none-any.whl diff --git a/Makefile b/Makefile index ed766d7..f68167d 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,8 @@ -build: clean - pip install -r requirements.txt - pip install pyinstaller - pyinstaller gotify-tray.spec - cp -r debian build/debian - mkdir build/debian/usr/lib - cp -r dist/gotify-tray build/debian/usr/lib/gotify-tray - dpkg -b build/debian dist/gotify-tray_amd64.deb - build-macos: clean pip install -r requirements.txt pip install pyinstaller pip install Pillow pyinstaller gotify-tray.spec -install: build - sudo dpkg -i dist/gotify-tray_amd64.deb - -uninstall: - sudo dpkg -r gotify-tray - clean: rm -rf dist build diff --git a/build-linux.sh b/build-linux.sh new file mode 100644 index 0000000..2506ca1 --- /dev/null +++ b/build-linux.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +if [ $# -eq 0 ] + then + echo "Call the script with the desired fpm output type [deb, pacman, ...]" + exit +fi + +rm -rf build/linux + +pyinstaller gotify-tray.spec + +mkdir -p build/linux/opt +mkdir -p build/linux/usr/share/applications +mkdir -p build/linux/usr/share/icons + +cp -r dist/gotify-tray build/linux/opt/gotify-tray +cp gotify_tray/gui/images/logo.ico build/linux/usr/share/icons/gotify-tray.ico +cp gotifytray.desktop build/linux/usr/share/applications + +find build/linux/opt/gotify-tray -type f -exec chmod 644 -- {} + +find build/linux/opt/gotify-tray -type d -exec chmod 755 -- {} + +find build/linux/usr/share -type f -exec chmod 644 -- {} + +chmod +x build/linux/opt/gotify-tray/gotify-tray + +fpm --verbose \ + -C build/linux \ + -s dir \ + -t $1 \ + -p dist/ \ + -n gotify-tray \ + --url https://github.com/seird/gotify-tray \ + -m k.dries@protonmail.com \ + --description "Gotify Tray. A tray notification application for receiving messages from a Gotify server." \ + --category internet \ + --version "$(cat version.txt)" \ + --license GPLv3 diff --git a/debian/DEBIAN/control b/debian/DEBIAN/control deleted file mode 100644 index 44ab3c3..0000000 --- a/debian/DEBIAN/control +++ /dev/null @@ -1,6 +0,0 @@ -Package: gotify-tray -Version: 0.5.1 -Architecture: amd64 -Maintainer: k.dries@protonmail.com -Description: Gotify Tray - A tray notification application for receiving messages from a Gotify server. diff --git a/debian/usr/share/icons/gotify-tray.ico b/debian/usr/share/icons/gotify-tray.ico deleted file mode 100644 index f6607b6..0000000 Binary files a/debian/usr/share/icons/gotify-tray.ico and /dev/null differ diff --git a/debian/usr/share/applications/gotifytray.desktop b/gotifytray.desktop similarity index 76% rename from debian/usr/share/applications/gotifytray.desktop rename to gotifytray.desktop index c98aaff..339eff8 100644 --- a/debian/usr/share/applications/gotifytray.desktop +++ b/gotifytray.desktop @@ -1,8 +1,8 @@ [Desktop Entry] Name=Gotify Tray Comment=A tray notification application for receiving messages from a Gotify server. -Path=/usr/lib/gotify-tray -Exec=/usr/lib/gotify-tray/gotify-tray +Path=/opt/gotify-tray +Exec=/opt/gotify-tray/gotify-tray Icon=/usr/share/icons/gotify-tray.ico Terminal=false Type=Application