From ee3eddb044f699df732949c01b268ca6050020eb Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Wed, 3 Aug 2022 21:57:27 +0300 Subject: [PATCH] Create Workflow to Publish Application to (test) PyPI --- .github/workflows/publish.yml | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..42c746ba --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,40 @@ +name: publish + +on: + pull_request: + branches: + - 'master' + paths: + - setup.py + - .github/workflows/publish.yml + +jobs: + test: + name: Publish App to PyPI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install Python Dependencies + run: | + python -m pip install --upgrade pip + pip install build, twine + pip install --upgrade . + + - name: Build Application + run: | + rm -rf dist + python -m build + + - name: Publish App to Test PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_KEY }} + run: | + twine check dist/* + twine upload -r testpypi dist/* \ No newline at end of file