From 349a4dd6690948f5577775ef4f22db6d51b5691e Mon Sep 17 00:00:00 2001 From: Manabu Niseki Date: Sun, 9 Jul 2023 08:54:47 +0900 Subject: [PATCH] ci: add publish workflow --- .github/workflows/publish.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 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 0000000..387b235 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,33 @@ +name: Publish package + +on: + release: + types: ["created"] + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.11 + + - name: Setup Poetry + uses: abatilo/actions-poetry@v2 + with: + poetry-version: 1.5.1 + + - name: Install plugin + run: poetry self add "poetry-dynamic-versioning[plugin]" + + - name: Set PyPI token + env: + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + run: poetry config pypi-token.pypi $PYPI_TOKEN + + - name: Build and publish + run: poetry publish --build