diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..2bd9c24 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,31 @@ +# This workflows will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: Upload Python Package + +on: + release: + types: [created] + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* diff --git a/discover_overlay/__init__.py b/discover_overlay/__init__.py new file mode 100644 index 0000000..7ef8049 --- /dev/null +++ b/discover_overlay/__init__.py @@ -0,0 +1 @@ +from .discover_overlay import * diff --git a/discover.py b/discover_overlay/discover_overlay.py similarity index 97% rename from discover.py rename to discover_overlay/discover_overlay.py index 16ad8ab..be1709e 100755 --- a/discover.py +++ b/discover_overlay/discover_overlay.py @@ -1,5 +1,15 @@ -#!/usr/bin/python3 - +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import gi import os import sys @@ -1053,7 +1063,8 @@ def main(): pass -if __name__ == "__main__": +def entrypoint(): + global ws,win,box,tray,settings,ind,menu,warn_connection,error_connection ws=None win=None box=None @@ -1064,3 +1075,6 @@ if __name__ == "__main__": warn_connection=True error_connection=True main() + +if __name__ == "__main__": + entrypoint() diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..fd5e03c --- /dev/null +++ b/setup.py @@ -0,0 +1,42 @@ +from setuptools import setup, find_packages + +def readme(): + return open('README.md','r').read() + +setup( + name = 'discover-overlay', + author = 'trigg', + author_email = '', + version = '0.1', + description= 'Voice chat overlay', + long_description = readme(), + long_description_content_type = 'text/markdown', + url = 'https://github.com/trigg/Discover', + packages = find_packages(), + include_package_data = True, + data_files = [ + ('share/icons', ['discover.png']) + ], + install_requires = [ + 'PyGObject', + 'websocket-client', + 'pyxdg', + ], + entry_points = { + 'console_scripts': [ + 'discover-overlay = discover_overlay.discover_overlay:entrypoint', + ] + }, + classifiers = [ + 'Development Status :: 4 - Beta', + 'Environment :: X11 Applications :: GTK', + 'Intended Audience :: End Users/Desktop', + 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 3 :: Only', + 'Topic :: Communications :: Chat', + 'Topic :: Communications :: Conferencing', + ], + keywords = 'discord overlay voice linux', + license = 'GPLv3+', +)