File tree Expand file tree Collapse file tree 1 file changed +31
-2
lines changed Expand file tree Collapse file tree 1 file changed +31
-2
lines changed Original file line number Diff line number Diff line change 1
1
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2
2
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3
3
4
- name : Python package
4
+ name : CI/CD
5
5
6
6
on :
7
7
push :
8
8
pull_request :
9
9
branches : [ dev ]
10
10
11
11
jobs :
12
- build :
12
+ ci :
13
13
env :
14
14
# Fake a TRAVIS env so that the pre-existing test cases would behave like before
15
15
TRAVIS : true
19
19
LAB_OBO_CONFIDENTIAL_CLIENT_ID : ${{ secrets.LAB_OBO_CONFIDENTIAL_CLIENT_ID }}
20
20
LAB_OBO_PUBLIC_CLIENT_ID : ${{ secrets.LAB_OBO_PUBLIC_CLIENT_ID }}
21
21
22
+ # Derived from https://docs.github.com/en/actions/guides/building-and-testing-python#starting-with-the-python-workflow-template
22
23
runs-on : ubuntu-latest
23
24
strategy :
24
25
matrix :
58
59
- name : Test with pytest
59
60
run : |
60
61
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 }}
You can’t perform that action at this time.
0 commit comments