File tree 2 files changed +46
-3
lines changed
2 files changed +46
-3
lines changed Original file line number Diff line number Diff line change
1
+ name : Publish Python Package
2
+
3
+ on :
4
+ # trigger when publishing a release
5
+ release :
6
+ types : [published]
7
+
8
+ # also allow triggering this workflow manually for testing
9
+ workflow_dispatch :
10
+
11
+ jobs :
12
+ publish :
13
+
14
+ runs-on : ubuntu-latest
15
+
16
+ steps :
17
+ - name : Checkout
18
+ uses : actions/checkout@v2
19
+ with :
20
+ # just fetching 1 commit is not enough for setuptools-scm, so we fetch all
21
+ fetch-depth : 0
22
+ - name : Set up Python
23
+ uses : actions/setup-python@v2
24
+ with :
25
+ python-version : ' 3.x'
26
+ - name : Install dependencies
27
+ run : |
28
+ pip install setuptools setuptools_scm
29
+ - name : Build package
30
+ run : |
31
+ python setup.py sdist
32
+ rm dist/*.orig # clean sdist_upip noise
33
+ - name : Publish to Test PyPI
34
+ uses : pypa/gh-action-pypi-publish@release/v1
35
+ with :
36
+ password : ${{ secrets.TEST_PYPI_API_TOKEN }}
37
+ repository_url : https://test.pypi.org/legacy/
38
+ - name : Publish to PyPI
39
+ uses : pypa/gh-action-pypi-publish@release/v1
40
+ if : github.event.release.tag_name # only when releasing a new version
41
+ with :
42
+ password : ${{ secrets.PYPI_API_TOKEN }}
Original file line number Diff line number Diff line change 2
2
import sdist_upip
3
3
from setuptools import setup
4
4
5
- VERSION = "1.0.0"
6
-
7
5
8
6
def long_desc_from_readme ():
9
7
with open ('README.rst' , 'r' ) as fd :
@@ -20,7 +18,9 @@ def long_desc_from_readme():
20
18
21
19
setup (
22
20
name = "micropython-py-esp32-ulp" ,
23
- version = VERSION ,
21
+ use_scm_version = {
22
+ 'local_scheme' : 'no-local-version' ,
23
+ },
24
24
description = "Assembler toolchain for the ESP32 ULP co-processor, written in MicroPython" ,
25
25
long_description = long_desc_from_readme (),
26
26
long_description_content_type = 'text/x-rst' ,
@@ -34,6 +34,7 @@ def long_desc_from_readme():
34
34
'License :: OSI Approved :: MIT License' ,
35
35
'Programming Language :: Python :: Implementation :: MicroPython' ,
36
36
],
37
+ setup_requires = ['setuptools_scm' ],
37
38
platforms = ["esp32" , "linux" , "darwin" ],
38
39
cmdclass = {"sdist" : sdist_upip .sdist },
39
40
packages = ["esp32_ulp" ],
You can’t perform that action at this time.
0 commit comments