File tree Expand file tree Collapse file tree 2 files changed +34
-25
lines changed
Expand file tree Collapse file tree 2 files changed +34
-25
lines changed Original file line number Diff line number Diff line change 1+ # This will run every time a tag is created and pushed to the repository.
2+ # It calls our tests workflow via a `workflow_call`, and if tests pass
3+ # then it triggers our upload to PyPI for a new release.
4+ name : Publish to PyPI
5+ on :
6+ release :
7+ types : ["published"]
8+
9+ jobs :
10+ tests :
11+ uses : ./.github/workflows/tests.yml
12+ publish :
13+ name : publish
14+ needs : [tests] # require tests to pass before deploy runs
15+ runs-on : ubuntu-latest
16+ steps :
17+ - name : Checkout source
18+ uses : actions/checkout@v3
19+ - name : Set up Python 3.9
20+ uses : actions/setup-python@v4
21+ with :
22+ python-version : 3.9
23+
24+ - name : Build package
25+ run : |
26+ python -m pip install -U pip build
27+ python -m build
28+
29+ - name : Publish
30+ uses : pypa/gh-action-pypi-publish@v1.5.1
31+ with :
32+ user : __token__
33+ password : ${{ secrets.PYPI_KEY }}
Original file line number Diff line number Diff line change 66 tags :
77 - ' v*'
88 pull_request :
9+ workflow_call :
910
1011env :
1112 PY_COLORS : 1
@@ -105,28 +106,3 @@ jobs:
105106 temporaryPublicStorage : true
106107 uploadArtifacts : true
107108 runs : 5
108-
109- publish :
110- name : Publish to PyPI
111- needs : [pre-commit, tests]
112- if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
113-
114- runs-on : ubuntu-latest
115- steps :
116- - name : Checkout source
117- uses : actions/checkout@v3
118- - name : Set up Python 3.7
119- uses : actions/setup-python@v4
120- with :
121- python-version : 3.7
122-
123- - name : Build package
124- run : |
125- python -m pip install -U pip build
126- python -m build
127-
128- - name : Publish
129- uses : pypa/gh-action-pypi-publish@v1.5.1
130- with :
131- user : __token__
132- password : ${{ secrets.PYPI_KEY }}
You can’t perform that action at this time.
0 commit comments