Skip to content

Commit

Permalink
git action
Browse files Browse the repository at this point in the history
  • Loading branch information
Zochory committed Jul 20, 2024
1 parent 60f2043 commit 936af84
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 11 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 1 addition & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -242,4 +233,3 @@ asyncio_mode = "auto"
timeout = 600
log_cli = true
log_cli_level = "INFO"

0 comments on commit 936af84

Please sign in to comment.