use fpm to build deb; installs to /opt/gotify-tray/

This commit is contained in:
dries.k
2023-08-22 20:59:30 +02:00
parent 851056852d
commit 0f5caf1b9d
7 changed files with 72 additions and 66 deletions

View File

@@ -36,7 +36,6 @@ jobs:
path: gotify-tray-installer-win.exe path: gotify-tray-installer-win.exe
build-ubuntu: build-ubuntu:
if: ${{ github.actor != 'dependabot[bot]' }}
strategy: strategy:
matrix: matrix:
tag: [jammy] tag: [jammy]
@@ -49,18 +48,24 @@ jobs:
python-version: '3.10.8' python-version: '3.10.8'
- name: Upgrade pip and enable wheel support - name: Upgrade pip and enable wheel support
run: python -m pip install --upgrade pip setuptools wheel run: python -m pip install --upgrade pip setuptools wheel
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- name: Build - name: Build
run: | run: |
make build pip install -r requirements.txt
cp dist/gotify-tray_amd64.deb gotify-tray_amd64_ubuntu_${{ matrix.tag }}.deb 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 - name: Upload artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: gotify-tray_amd64_ubuntu_${{ matrix.tag }}.deb path: "gotify-tray_*_amd64_${{ matrix.tag }}.deb"
path: gotify-tray_amd64_ubuntu_${{ matrix.tag }}.deb
build-macos: build-macos:
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: macos-12 runs-on: macos-12
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@@ -33,29 +33,6 @@ jobs:
name: gotify-tray-installer-win.exe name: gotify-tray-installer-win.exe
path: 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: build-debian:
strategy: strategy:
matrix: matrix:
@@ -69,15 +46,22 @@ jobs:
python-version: '3.10.8' python-version: '3.10.8'
- name: Upgrade pip and enable wheel support - name: Upgrade pip and enable wheel support
run: python -m pip install --upgrade pip setuptools wheel run: python -m pip install --upgrade pip setuptools wheel
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- name: Build - name: Build
run: | run: |
make build pip install -r requirements.txt
cp dist/gotify-tray_amd64.deb gotify-tray_amd64_debian_${{ matrix.tag }}.deb 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 - name: Upload artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: gotify-tray_amd64_debian_${{ matrix.tag }}.deb name: gotify-tray_${{github.ref_name}}_amd64_${{ matrix.tag }}.deb
path: gotify-tray_amd64_debian_${{ matrix.tag }}.deb path: gotify-tray_${{github.ref_name}}_amd64_${{ matrix.tag }}.deb
build-macos: build-macos:
runs-on: macos-12 runs-on: macos-12
@@ -102,6 +86,11 @@ jobs:
pypi: pypi:
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/gotify-tray
permissions:
id-token: write
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set up Python - name: Set up Python
@@ -118,17 +107,15 @@ jobs:
run: python -m build run: python -m build
- name: upload to pypi - name: upload to pypi
uses: pypa/gh-action-pypi-publish@release/v1 uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: 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 path: dist/gotify_tray-${{github.ref_name}}-py3-none-any.whl
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [build-win64, build-ubuntu, build-debian, build-macos, pypi] needs: [build-win64, build-debian, build-macos, pypi]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3
@@ -139,9 +126,7 @@ jobs:
prerelease: false prerelease: false
files: | files: |
gotify-tray-installer-win.exe 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.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

View File

@@ -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 build-macos: clean
pip install -r requirements.txt pip install -r requirements.txt
pip install pyinstaller pip install pyinstaller
pip install Pillow pip install Pillow
pyinstaller gotify-tray.spec pyinstaller gotify-tray.spec
install: build
sudo dpkg -i dist/gotify-tray_amd64.deb
uninstall:
sudo dpkg -r gotify-tray
clean: clean:
rm -rf dist build rm -rf dist build

37
build-linux.sh Normal file
View File

@@ -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

View File

@@ -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.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

View File

@@ -1,8 +1,8 @@
[Desktop Entry] [Desktop Entry]
Name=Gotify Tray Name=Gotify Tray
Comment=A tray notification application for receiving messages from a Gotify server. Comment=A tray notification application for receiving messages from a Gotify server.
Path=/usr/lib/gotify-tray Path=/opt/gotify-tray
Exec=/usr/lib/gotify-tray/gotify-tray Exec=/opt/gotify-tray/gotify-tray
Icon=/usr/share/icons/gotify-tray.ico Icon=/usr/share/icons/gotify-tray.ico
Terminal=false Terminal=false
Type=Application Type=Application