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 6
6
pull_request :
7
7
schedule :
8
8
- cron : " 0 8 * * *"
9
+ workflow_call :
9
10
10
11
jobs :
11
12
pre-commit :
36
37
uses : actions/setup-python@v5
37
38
with :
38
39
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
44
42
- name : Run tests
45
43
run : hatch run test:test -x
46
44
49
47
steps :
50
48
- uses : actions/checkout@v4
51
49
- 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
56
52
- 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