File tree Expand file tree Collapse file tree 2 files changed +38
-33
lines changed
Expand file tree Collapse file tree 2 files changed +38
-33
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+
13+ publish :
14+ needs : [tests]
15+ name : Publish to PyPi
16+ runs-on : ubuntu-latest
17+ steps :
18+ - name : Checkout source
19+ uses : actions/checkout@v4
20+ - name : Set up Python 3.10
21+ uses : actions/setup-python@v5
22+ with :
23+ python-version : 3.10
24+ - name : Build package
25+ run : |
26+ pip install wheel
27+ python setup.py sdist bdist_wheel
28+ - name : Publish
29+ uses : pypa/gh-action-pypi-publish@v1.8.11
30+ with :
31+ user : __token__
32+ password : ${{ secrets.PYPI_KEY }}
Original file line number Diff line number Diff line change 66 pull_request :
77 schedule :
88 - cron : " 0 8 * * *"
9+ workflow_call :
910
1011jobs :
1112 pre-commit :
3637 uses : actions/setup-python@v5
3738 with :
3839 python-version : ${{ matrix.python-version }}
39-
40- - name : Install dependencies
41- run : |
42- python -m pip install --upgrade pip hatch
43-
40+ - name : Install hatch
41+ run : pip install hatch
4442 - name : Run tests
4543 run : hatch run test:test -x
4644
4947 steps :
5048 - uses : actions/checkout@v4
5149 - uses : actions/setup-python@v5
52- - name : Install dependencies
53- run : |
54- python -m pip install --upgrade pip hatch
55-
50+ - name : Install hatch
51+ run : pip install hatch
5652 - name : Build docs
57- run : |
58- hatch run doc:build
59-
60- publish :
61- name : Publish to PyPi
62- needs : [tests]
63- if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
64- runs-on : ubuntu-latest
65- steps :
66- - name : Checkout source
67- uses : actions/checkout@v4
68- - name : Set up Python 3.8
69- uses : actions/setup-python@v5
70- with :
71- python-version : 3.8
72- - name : Build package
73- run : |
74- pip install wheel
75- python setup.py sdist bdist_wheel
76- - name : Publish
77- uses : pypa/gh-action-pypi-publish@v1.8.11
78- with :
79- user : __token__
80- password : ${{ secrets.PYPI_KEY }}
53+ run : hatch run doc:build
You can’t perform that action at this time.
0 commit comments