From 5607fe63d2fd544365d7afeb6e192ff8945958f5 Mon Sep 17 00:00:00 2001 From: Dowon Date: Thu, 28 Mar 2024 20:20:10 +0900 Subject: [PATCH] ci: pypi publish action --- .github/workflows/pypi.yml | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 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..9136cc7 --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,45 @@ +name: Publish to PyPI +on: + push: + tags: + - "v*" + +jobs: + test: + name: test + runs-on: macos-14 + strategy: + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + pip install . + pip install pytest + + - name: Run tests + run: pytest -v + + build: + name: build + runs-on: ubuntu-latest + permissions: + id-token: write + needs: [test] + + steps: + - uses: actions/checkout@v4 + + - name: Build wheel + run: pipx run build + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1