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