File tree Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -14,18 +14,19 @@ jobs:
1414 uses : actions/setup-python@v4
1515 with :
1616 python-version : 3.8
17- - name : Set package version
17+ - name : Build wheel
1818 run : |
19- version="${{ github.event.release.tag_name }}"
20- version="${version,,}" # lowercase it
21- version="${version#v}" # remove `v`
22- sed -i "s/version = \"0\.0\.0\"/version = \"${version}\"/" pyproject.toml
23- - name : Install wheel
24- run : >-
19+ VERSION="${{ github.event.release.tag_name }}"
20+ VERSION="${VERSION,,}" # lowercase it
21+ VERSION="${VERSION#v}" # remove `v`
22+
2523 pip install wheel build
26- - name : Build
27- run : >-
2824 python3 -m build
25+
26+ # Fail if we don't generate a package with the expected version
27+ if ( ! ls -A "dist/*${VERSION}*.whl" 1> /dev/null 2>&1 ); then
28+ exit 1
29+ fi
2930 - name : Publish distribution to PyPI
3031 uses : pypa/gh-action-pypi-publish@release/v1
3132 with :
Original file line number Diff line number Diff line change 11[build-system ]
2- requires = [" setuptools>=61.0.0" ]
2+ requires = [" setuptools>=61.0.0" , " wheel " , " setuptools-git-versioning<2 " ]
33build-backend = " setuptools.build_meta"
44
55[project ]
66name = " zigpy-znp"
7- version = " 0.0.0 "
7+ dynamic = [ " version " ]
88description = " A library for zigpy which communicates with TI ZNP radios"
99urls = {repository = " https://github.com/zigpy/zigpy-znp" }
1010authors = [
@@ -34,6 +34,9 @@ testing = [
3434 " coveralls" ,
3535]
3636
37+ [tool .setuptools-git-versioning ]
38+ enabled = true
39+
3740
3841[tool .black ]
3942safe = true
You can’t perform that action at this time.
0 commit comments