diff --git a/.github/workflows/test.yaml b/.github/workflows/ci.yaml similarity index 57% rename from .github/workflows/test.yaml rename to .github/workflows/ci.yaml index 3ccb727..bb033da 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/ci.yaml @@ -44,4 +44,37 @@ jobs: - name: Coverage uses: codecov/codecov-action@v5 with: - token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + token: ${{ secrets.CODECOV_TOKEN }} + + deploy: + name: Deploy + needs: test + if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'schedule' + runs-on: ubuntu-latest + + permissions: + id-token: write + contents: write + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: 🐍 Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: 👷 Build + run: | + python -m pip install build + python -m build + + - name: 🚢 Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + + - uses: softprops/action-gh-release@v2 + with: + generate_release_notes: true + files: "./dist/*" \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 132eae7..d5de093 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,16 @@ +[build-system] +requires = ["setuptools", "setuptools-scm"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] + [project] name = "geff" -version = "0.1.0" description = "Reference implementation of the Graph Exchange File Format" readme = "README.md" requires-python = ">=3.10" license = { text = "MIT License" } +dynamic = ['version'] dependencies = [ "spatial-graph @ git+https://github.com/funkelab/spatial_graph.git@d02b691e4fa0f184871939a89c6f964bfd0f5e39", "zarr<3.0.0", @@ -19,13 +25,9 @@ dev = [ "ruff" ] -[build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" - -[tool.hatch.metadata] -# Enables installing from git commit -allow-direct-references = true +[project.urls] +repository = "https://github.com/funkelab/geff" +homepage = "https://github.com/funkelab/geff" # https://github.com/charliermarsh/ruff [tool.ruff]