From 32a4fa17723bce05db21afa67a473dc4285f8786 Mon Sep 17 00:00:00 2001 From: Xintao Date: Sun, 8 Aug 2021 16:20:01 +0800 Subject: [PATCH] add publish-pip action --- .github/workflows/publish-pip.yml | 30 ++++++++++++++++++++++++++++++ MANIFEST.in | 1 + 2 files changed, 31 insertions(+) create mode 100644 .github/workflows/publish-pip.yml diff --git a/.github/workflows/publish-pip.yml b/.github/workflows/publish-pip.yml new file mode 100644 index 0000000..06047f7 --- /dev/null +++ b/.github/workflows/publish-pip.yml @@ -0,0 +1,30 @@ +name: PyPI Publish + +on: push + +jobs: + build-n-publish: + runs-on: ubuntu-latest + if: startsWith(github.event.ref, 'refs/tags') + + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Upgrade pip + run: pip install pip --upgrade + - name: Install PyTorch (cpu) + run: pip install torch==1.7.0+cpu torchvision==0.8.1+cpu -f https://download.pytorch.org/whl/torch_stable.html + - name: Install dependencies + run: pip install -r requirements.txt + - name: Build and install + run: rm -rf .eggs && pip install -e . + - name: Build for distribution + # remove bdist_wheel for pip installation with compiling cuda extensions + run: python setup.py sdist + - name: Publish distribution to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/MANIFEST.in b/MANIFEST.in index 11233df..b18403e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,5 +3,6 @@ include inputs/* include scripts/*.py include inference_realesrgan.py include VERSION +include LICENSE include requirements.txt include realesrgan/weights/README.md