File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed
Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy to PyPI
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*.*.*' # This will trigger the workflow only when a tag that matches the pattern is pushed
7+
8+ jobs :
9+ deploy :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout Code
14+ uses : actions/checkout@v2
15+ with :
16+ submodules : recursive
17+
18+ - name : Set up Python
19+ uses : actions/setup-python@v2
20+ with :
21+ python-version : ' 3.x'
22+
23+ - name : Check Tag and setup.py Version Match
24+ run : |
25+ TAG_VERSION=${GITHUB_REF#refs/tags/v}
26+ SETUP_VERSION=$(grep -oE "version='([^']+)" setup.py | grep -oE '[^=]+$')
27+ if [[ "$TAG_VERSION" != "$SETUP_VERSION" ]]; then
28+ echo "Tag version $TAG_VERSION does not match setup.py version $SETUP_VERSION."
29+ exit 1
30+ fi
31+
32+ - name : Install dependencies
33+ run : |
34+ python -m pip install --upgrade pip
35+ pip install jinja2 setuptools wheel
36+ generate/generate-python.py --output-dir=brping
37+
38+ - name : Build package
39+ run : |
40+ python setup.py sdist bdist_wheel
41+
42+ - name : Build and Publish
43+ uses : pypa/gh-action-pypi-publish@v1.8.10
44+ with :
45+ user : __token__
46+ password : ${{ secrets.PYPI_TOKEN }}
47+ distributions : " sdist bdist_wheel"
You can’t perform that action at this time.
0 commit comments