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:
14
14
uses : actions/setup-python@v4
15
15
with :
16
16
python-version : 3.8
17
- - name : Set package version
17
+ - name : Build wheel
18
18
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
+
25
23
pip install wheel build
26
- - name : Build
27
- run : >-
28
24
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
29
30
- name : Publish distribution to PyPI
30
31
uses : pypa/gh-action-pypi-publish@release/v1
31
32
with :
Original file line number Diff line number Diff line change 1
1
[build-system ]
2
- requires = [" setuptools>=61.0.0" ]
2
+ requires = [" setuptools>=61.0.0" , " wheel " , " setuptools-git-versioning<2 " ]
3
3
build-backend = " setuptools.build_meta"
4
4
5
5
[project ]
6
6
name = " zigpy-znp"
7
- version = " 0.0.0 "
7
+ dynamic = [ " version " ]
8
8
description = " A library for zigpy which communicates with TI ZNP radios"
9
9
urls = {repository = " https://github.com/zigpy/zigpy-znp" }
10
10
authors = [
@@ -34,6 +34,9 @@ testing = [
34
34
" coveralls" ,
35
35
]
36
36
37
+ [tool .setuptools-git-versioning ]
38
+ enabled = true
39
+
37
40
38
41
[tool .black ]
39
42
safe = true
You can’t perform that action at this time.
0 commit comments