File tree Expand file tree Collapse file tree 1 file changed +37
-1
lines changed Expand file tree Collapse file tree 1 file changed +37
-1
lines changed Original file line number Diff line number Diff line change 6
6
# Packages that use it probably do not want to continue testing with editable installations,
7
7
# quadrupling their test load.
8
8
9
+ # For deployment, it will be necessary to create a PyPI API token and store it as a secret
10
+ # https://docs.github.com/en/actions/reference/encrypted-secrets
11
+
9
12
name : Python package
10
13
11
14
# Set once
15
18
on :
16
19
push :
17
20
branches : [ main ]
21
+ tags : [ '*' ]
18
22
pull_request :
19
23
branches : [ main ]
20
24
21
25
jobs :
22
- build :
26
+ test :
23
27
runs-on : ubuntu-latest
24
28
strategy :
25
29
matrix :
50
54
- name : Test with pytest
51
55
run : |
52
56
pytest -sv --doctest-modules pydra/tasks/$SUBPACKAGE
57
+
58
+ deploy :
59
+ needs : test
60
+ runs-on : ubuntu-latest
61
+ strategy :
62
+ matrix :
63
+ python-version : [3.9]
64
+ steps :
65
+ - uses : actions/checkout@v2
66
+ with :
67
+ submodules : recursive
68
+ fetch-depth : 0
69
+ - name : Set up Python ${{ matrix.python-version }}
70
+ uses : actions/setup-python@v2
71
+ with :
72
+ python-version : ${{ matrix.python-version }}
73
+ - name : Install build tools
74
+ run : python -m pip install --upgrade pip setuptools wheel twine
75
+ - name : Build source and wheel distributions
76
+ run : python setup.py sdist bdist_wheel
77
+ - name : Check distributions
78
+ run : twine check dist/*
79
+ - uses : actions/upload-artifact@v2
80
+ with :
81
+ name : distributions
82
+ path : dist/
83
+ - name : Upload to PyPI (on tags)
84
+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
85
+ uses : pypa/gh-action-pypi-publish@master
86
+ with :
87
+ user : __token__
88
+ password : ${{ secrets.PYPI_API_TOKEN }}
You can’t perform that action at this time.
0 commit comments