name: release on: push: tags: - '*' jobs: build-deb: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.13' - 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 - name: Debug Python lib run: | echo "Python version: $(python --version)" find /opt/hostedtoolcache -name "libpython*.so" 2>/dev/null || echo "Not found in toolcache" ls -la /lib/x86_64-linux-gnu/libpython* 2>/dev/null || echo "Not found in /lib" - name: Build binary run: pyinstaller gotify-tray.spec - name: Set version run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV - name: Install Ruby and fpm run: | sudo apt-get update sudo apt-get install -y ruby-full gem install fpm export PATH="$(ruby -e 'puts Gem.user_dir')/bin:$PATH" - name: Check fpm run: which fpm - name: Build Debian package run: | mkdir -p build/linux/opt mkdir -p build/linux/usr/share/applications mkdir -p build/linux/usr/share/pixmaps cp -r dist/gotify-tray build/linux/opt/gotify-tray cp gotify_tray/gui/images/gotify-small.png build/linux/usr/share/pixmaps/gotify-tray.png 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 deb \ -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 "$VERSION" \ --license GPLv3 - name: Check deb file run: ls -la dist/ - name: Create release run: | RESPONSE=$(curl -X POST \ -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \ -H "Content-Type: application/json" \ -d "{\"tag_name\": \"${GITHUB_REF_NAME}\", \"name\": \"Release ${GITHUB_REF_NAME}\", \"body\": \"Automated release\"}" \ http://192.168.88.97:3000/api/v1/repos/kadu/gotify-tray-customized/releases) echo "Release response: $RESPONSE" RELEASE_ID=$(echo $RESPONSE | jq -r '.id') echo "RELEASE_ID=$RELEASE_ID" >> $GITHUB_ENV - name: Upload asset run: | curl -X POST \ -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \ -H "Content-Type: application/octet-stream" \ --data-binary @dist/gotify-tray_${VERSION}_amd64.deb \ http://192.168.88.97:3000/api/v1/repos/kadu/gotify-tray-customized/releases/${RELEASE_ID}/assets?name=gotify-tray_${VERSION}_amd64.deb