From 653d9055764e51e3ff338544a3697470389a0376 Mon Sep 17 00:00:00 2001 From: Seongbum Seo Date: Tue, 14 Feb 2023 19:34:48 +0900 Subject: [PATCH] Add PyPI publish workflow --- .github/workflows/pypi.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 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..b27f0ca --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,28 @@ +name: Publish Python Distributions + +on: + push: + branches: + - main + +jobs: + publish: + name: Build and publish to PyPI + runs-on: ubuntu-latest + + steps: + - name: Checkout full source + uses: actions/checkout@master + - name: Set up python 3.7 + uses: actions/setup-python@v3 + with: + python-version: '3.7' + - name: Install pypa/build + run: python -m pip install build --user + - name: Build a binary wheel and a source tarball + run: python -m build --sdist --wheel --outdir dist/ . + - name: Publish distribution to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }}