From 1a0a236ce8434c4bad4bf80b6dbf2ba07fdf509f Mon Sep 17 00:00:00 2001 From: Ayush Anand <36472216+ayushanand18@users.noreply.github.com> Date: Sun, 4 Jun 2023 15:02:12 +0530 Subject: [PATCH] adds pypi workflow file --- .github/workflows/pypi.yml | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/pypi.yml diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 0000000..a0c8e67 --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,46 @@ +name: Publish to PyPI + +on: + release: + types: [published] + +jobs: + packages: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.x + + - name: Get tags + run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* + shell: bash + + - name: Install build tools + run: | + python -m pip install --upgrade pip wheel setuptools setuptools_scm build twine + + shell: bash + + - name: Build binary wheel + run: python -m build --sdist --wheel . --outdir dist + + - name: CheckFiles + run: | + ls dist + shell: bash + + - name: Test wheels + run: | + cd dist && python -m pip install pydwcviz*.whl + python -m twine check * + shell: bash + + - name: Publish a Python distribution to PyPI + uses: pypa/gh-action-pypi-publish@v1.5.1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }}