Skip to content

Commit

Permalink
tag-based version detection
Browse files Browse the repository at this point in the history
  • Loading branch information
jornbr committed May 15, 2024
1 parent 5b255d9 commit b6c8520
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/publish_to_pypi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Python to PyPI
name: Build and publish

on: push

Expand All @@ -9,19 +9,22 @@ jobs:
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # for version detection by hatch-vcs/setuptools_scm
- name: Set up Python
uses: actions/setup-python@v5
- name: Install build
run: pip install build
- name: Build a binary wheel and a source tarball
run: python -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
publish-to-pypi:
name: Publish distribution to PyPI
name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
environment:
name: pypi
Expand All @@ -30,7 +33,7 @@ jobs:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
requires = ["hatchling"]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[project]
name = "pyncview"
version = "0.99.38"
dynamic = ["version"]
readme = "README.md"
dependencies = [
"xmlplot>=0.9.28",
Expand Down Expand Up @@ -33,3 +33,6 @@ pyncview = "pyncview.pyncview:main"

[tool.hatch.build.targets.sdist]
only-include = ["pyncview"]

[tool.hatch.version]
source = "vcs"

0 comments on commit b6c8520

Please sign in to comment.