From f883ca8571840803511e878d7a602b77bd425dbd Mon Sep 17 00:00:00 2001 From: Gareth Latty Date: Thu, 31 Oct 2019 19:51:25 +0000 Subject: [PATCH] Add automated deployment to PyPI. --- .github/workflows/pythonpublish.yml | 26 ++++++++++++++++++++++++++ setup.py | 4 ++-- unrpa/__main__.py | 7 ++----- unrpa/meta.py | 6 +++++- 4 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/pythonpublish.yml diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml new file mode 100644 index 0000000..21f2f01 --- /dev/null +++ b/.github/workflows/pythonpublish.yml @@ -0,0 +1,26 @@ +name: Upload Python Package + +on: + release: + types: [created] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Set up Python + uses: actions/setup-python@v1 + 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: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* diff --git a/setup.py b/setup.py index 217dfae..e8fe97c 100644 --- a/setup.py +++ b/setup.py @@ -5,11 +5,11 @@ long_description = readme.read() setuptools.setup( - name="unrpa", + name=meta.name, version=meta.version, author="Gareth Latty", author_email="gareth@lattyware.co.uk", - description="Extract files from the RPA archive format (from the Ren'Py Visual Novel Engine).", + description=meta.description, long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/Lattyware/unrpa", diff --git a/unrpa/__main__.py b/unrpa/__main__.py index 049f9ed..54e7197 100644 --- a/unrpa/__main__.py +++ b/unrpa/__main__.py @@ -28,10 +28,7 @@ def main() -> None: - parser = argparse.ArgumentParser( - prog="unrpa", - description="Extract files from the RPA archive format (from the Ren'Py Visual Novel Engine).", - ) + parser = argparse.ArgumentParser(prog=meta.name, description=meta.description) parser.add_argument( "-v", @@ -112,7 +109,7 @@ def main() -> None: ) parser.add_argument( - "--version", action="version", version=f"%(prog)s {meta.version}" + "--version", action="version", version=f"{meta.name} {meta.version}" ) parser.add_argument( diff --git a/unrpa/meta.py b/unrpa/meta.py index 4c22740..ead76be 100644 --- a/unrpa/meta.py +++ b/unrpa/meta.py @@ -1 +1,5 @@ -version = "2.1.0" +name = "unrpa" +version = "2.1.1" +description = ( + "Extract files from the RPA archive format (from the Ren'Py Visual Novel Engine)." +)