From 65bf2960b32da0cefdbcb67823e70f083114e173 Mon Sep 17 00:00:00 2001 From: Yudai Udagawa Date: Sat, 4 Sep 2021 12:31:44 +0900 Subject: [PATCH] Create publish-to-test-pypi.yml --- .github/workflows/publish-to-test-pypi.yml | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/publish-to-test-pypi.yml diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml new file mode 100644 index 0000000..6d760e9 --- /dev/null +++ b/.github/workflows/publish-to-test-pypi.yml @@ -0,0 +1,37 @@ +name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI + +on: push +jobs: + build-n-publish: + name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@master + - name: Set up Python 3.9 + uses: actions/setup-python@v1 + with: + python-version: 3.9 + - 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 Test PyPI + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + - name: Publish distribution 📦 to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.PYPI_API_TOKEN }}