diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..37bbfa905 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,33 @@ +name: Publish to PyPI + +on: + push: + tags: + - 'v*' # Trigger on version tags + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # This is important for poetry-dynamic-versioning + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + pip install poetry + poetry install + + - name: Build package + run: poetry build + + - name: Publish to PyPI + env: + PYPI_USERNAME: __token__ + PYPI_PASSWORD: ${{ secrets.PYPI_TOKEN }} + run: poetry publish diff --git a/pyproject.toml b/pyproject.toml index 4135dc896..7cfd2df14 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,17 +9,8 @@ packages = [{ include = "graphfleet" }] [tool.poetry-dynamic-versioning] enable = true -style = "pep440" vcs = "git" -bump = true -format-jinja = """ - {%- if distance == 0 -%} - {{ serialize_pep440(base, stage, revision) }} - {%- else -%} - {{ serialize_pep440(base, stage, revision, dev=distance) }} - {%- endif -%} -""" - +style = "semver" [tool.poetry.dependencies] python = ">=3.10,<3.13" environs = "^11.0.0" @@ -242,4 +233,3 @@ asyncio_mode = "auto" timeout = 600 log_cli = true log_cli_level = "INFO" -