File tree Expand file tree Collapse file tree 2 files changed +32
-3
lines changed Expand file tree Collapse file tree 2 files changed +32
-3
lines changed Original file line number Diff line number Diff line change 11# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
22# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33
4- name : Python package
4+ name : CI/CD
55
66on :
77 push :
88 pull_request :
99 branches : [ dev ]
1010
1111jobs :
12- build :
12+ ci :
1313 env :
1414 # Fake a TRAVIS env so that the pre-existing test cases would behave like before
1515 TRAVIS : true
1919 LAB_OBO_CONFIDENTIAL_CLIENT_ID : ${{ secrets.LAB_OBO_CONFIDENTIAL_CLIENT_ID }}
2020 LAB_OBO_PUBLIC_CLIENT_ID : ${{ secrets.LAB_OBO_PUBLIC_CLIENT_ID }}
2121
22+ # Derived from https://docs.github.com/en/actions/guides/building-and-testing-python#starting-with-the-python-workflow-template
2223 runs-on : ubuntu-latest
2324 strategy :
2425 matrix :
5859 - name : Test with pytest
5960 run : |
6061 pytest
62+
63+ cd :
64+ needs : ci
65+ if : github.event_name == 'push' && (startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/main')
66+ runs-on : ubuntu-latest
67+ steps :
68+ - uses : actions/checkout@v2
69+ - name : Set up Python 3.9
70+ uses : actions/setup-python@v2
71+ with :
72+ python-version : 3.9
73+ - name : Build a package for release
74+ run : |
75+ python -m pip install build --user
76+ python -m build --sdist --wheel --outdir dist/ .
77+ - name : Publish to TestPyPI
78+ 79+ if : github.ref == 'refs/heads/main'
80+ with :
81+ user : __token__
82+ password : ${{ secrets.TEST_PYPI_API_TOKEN }}
83+ repository_url : https://test.pypi.org/legacy/
84+ - name : Publish to PyPI
85+ if : startsWith(github.ref, 'refs/tags')
86+ 87+ with :
88+ user : __token__
89+ password : ${{ secrets.PYPI_API_TOKEN }}
Original file line number Diff line number Diff line change 2121
2222
2323# The __init__.py will import this. Not the other way around.
24- __version__ = "1.8 .0"
24+ __version__ = "1.9 .0"
2525
2626logger = logging .getLogger (__name__ )
2727
You can’t perform that action at this time.
0 commit comments