File tree Expand file tree Collapse file tree 5 files changed +58
-1
lines changed Expand file tree Collapse file tree 5 files changed +58
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : release
2
+
3
+ on :
4
+ release :
5
+ types : [published]
6
+
7
+ jobs :
8
+ build-n-publish :
9
+ name : Build and publish Python 🐍 distributions 📦 to PyPI
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - uses : actions/checkout@v2
13
+
14
+ - name : Set up Python 3.9
15
+ uses : actions/setup-python@v1
16
+ with :
17
+ python-version : 3.9
18
+
19
+ - name : Install pypa/build
20
+ run : |
21
+ python -m pip install build --user
22
+
23
+ - name : Set version
24
+ run : |
25
+ echo -n ${GITHUB_REF} | cut -f3- -d/ > ./indi/VERSION
26
+
27
+ - name : Build a 📦
28
+ run : |
29
+ python -m build
30
+
31
+ - name : Publish distribution 📦 to Test PyPI
32
+ uses : pypa/gh-action-pypi-publish@release/v1.5
33
+ with :
34
+ password : ${{ secrets.TEST_PYPI_API_TOKEN }}
35
+ repository_url : https://test.pypi.org/legacy/
36
+
37
+ - name : Publish distribution 📦 to PyPI
38
+ if : startsWith(github.ref, 'refs/tags')
39
+ uses : pypa/gh-action-pypi-publish@release/v1.5
40
+ with :
41
+ password : ${{ secrets.PYPI_API_TOKEN }}
Original file line number Diff line number Diff line change
1
+ include indi/VERSION
2
+ recursive-include requirements *.txt
3
+
4
+ recursive-exclude * __pycache__
5
+ recursive-exclude * *.py[co]
Original file line number Diff line number Diff line change
1
+ 0.2-dev
Original file line number Diff line number Diff line change 1
- __version__ = "0.2.0"
1
+ from os import path
2
+
3
+
4
+ with open (path .join (path .dirname (__file__ ), "VERSION" )) as f :
5
+ __version__ = f .read ().strip ()
6
+
2
7
__protocol_version__ = "1.7"
3
8
4
9
__author__ = "Wiktor Latanowicz"
Original file line number Diff line number Diff line change 1
1
import re
2
2
from pathlib import Path
3
+ from os import path
3
4
4
5
from setuptools import find_packages , setup
5
6
@@ -55,6 +56,10 @@ def get_about():
55
56
if regex .match (l ):
56
57
dunders .append (l )
57
58
exec ("\n " .join (dunders ), about )
59
+
60
+ with open (path .join (path .dirname (__file__ ), "indi" , "VERSION" )) as f :
61
+ about ["__version__" ] = f .read ().strip ()
62
+
58
63
return about
59
64
60
65
about = get_about ()
You can’t perform that action at this time.
0 commit comments