diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..3d30dd2 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,38 @@ +name: publish + +on: + push: + tags: + - v* + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + steps: + - uses: actions/checkout@v4 + - name: Setup python3.11 + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Fetch tags + run: git fetch --unshallow --tags || true + + - name: Install poetry + run: python -m pip install poetry + + - name: Install poem-plugins + run: poetry self add poem-plugins + + - name: Install package + run: poetry install + + - name: Mint token + id: mint + uses: tschm/token-mint-action@v1.0.2 + + - name: Publish to PyPI + run: poetry publish -u __token__ -p '${{ steps.mint.outputs.api-token }}' diff --git a/pyproject.toml b/pyproject.toml index 7cc159f..d5b5115 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,6 +66,7 @@ provider = "git" update_pyproject = true [tool.poem-plugins.version.git] +version_prefix = "v" format = "long" [tool.mypy]