File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change 1
1
name : CI
2
+
2
3
on :
3
4
push :
4
5
branches : [master]
5
6
tags : ['v*']
6
7
pull_request :
7
8
branches : [master]
9
+
8
10
jobs :
9
11
test :
10
12
runs-on : ubuntu-latest
@@ -44,15 +46,30 @@ jobs:
44
46
@semantic-release/exec \
45
47
@semantic-release/git \
46
48
@semantic-release/github
49
+
47
50
- name : Semantic Release
48
51
if : github.ref == 'refs/heads/master' && matrix.python-version == '3.8'
49
52
env :
50
53
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
51
54
GH_TOKEN : ${{ secrets.GH_TOKEN }}
52
55
run : npx semantic-release
53
- - name : Publish to PyPI
54
- if : startsWith(github.ref, 'refs/tags/') && matrix.python-version == '3.8'
56
+
57
+ # Separate job for PyPI publishing
58
+ publish :
59
+ needs : test
60
+ if : startsWith(github.ref, 'refs/tags/')
61
+ runs-on : ubuntu-latest
62
+ environment : ci
63
+ steps :
64
+ - uses : actions/checkout@v3
65
+ - name : Set up Python
66
+ uses : actions/setup-python@v4
67
+ with :
68
+ python-version : ' 3.8'
69
+ - name : Install dependencies
55
70
run : |
56
71
pip install build twine
72
+ - name : Build and publish
73
+ run : |
57
74
python -m build
58
- python -m twine upload dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }}
75
+ python -m twine upload dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }}
You can’t perform that action at this time.
0 commit comments