File tree Expand file tree Collapse file tree 2 files changed +46
-10
lines changed
Expand file tree Collapse file tree 2 files changed +46
-10
lines changed Original file line number Diff line number Diff line change 1+ name : Build and upload to PyPI
2+
3+ on :
4+ workflow_dispatch :
5+ pull_request :
6+ push :
7+ branches :
8+ - main
9+ release :
10+ types :
11+ - published
12+
13+ jobs :
14+ build :
15+ name : Build source distribution
16+ runs-on : ubuntu-latest
17+ steps :
18+ - uses : actions/checkout@v4
19+ with :
20+ submodules : true
21+
22+ - name : Build
23+ run : pipx run build
24+
25+ - uses : actions/upload-artifact@v3
26+ with :
27+ path : |
28+ dist/*.tar.gz
29+ dist/*.whl
30+
31+ upload_pypi :
32+ needs : build
33+ runs-on : ubuntu-latest
34+ environment : release
35+ permissions :
36+ id-token : write
37+ if : github.event_name == 'release' && github.event.action == 'published'
38+ steps :
39+ - uses : actions/download-artifact@v3
40+ with :
41+ name : artifact
42+ path : dist
43+
44+ - uses : pypa/gh-action-pypi-publish@release/v1
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ version="${BASH_REMATCH[1]}"
2121date=" ${BASH_REMATCH[2]} "
2222notes=" $( echo " ${BASH_REMATCH[3]} " | sed -n -e ' /^[0-9]\+\.[0-9]\+\.[0-9]\+/,$!p' ) "
2323
24- if [[ " $date " != " $( date +" %Y-%m-%d" ) " ]]; then
24+ if [[ " $date " != " $( date +" %Y-%m-%d" ) " ]]; then
2525 echo " $date is not today!"
2626 exit 1
2727fi
@@ -33,14 +33,11 @@ if [ -n "$(git status --porcelain)" ]; then
3333 exit 1
3434fi
3535
36- # Make sure Sphinx and wheel are installed with the current python
37- pip install sphinx wheel
38-
3936perl -pi -e " s/(?<=__version__ = \" ).+?(?=\" )/$version /gsm" geoip2/__init__.py
4037perl -pi -e " s/(?<=^version = \" ).+?(?=\" )/$version /gsm" pyproject.toml
4138
4239echo $" Test results:"
43- python setup.py test
40+ tox
4441
4542echo $' \n Diff:'
4643git diff
@@ -62,8 +59,3 @@ git push
6259gh release create --target " $( git branch --show-current) " -t " $version " -n " $notes " " $tag "
6360
6461git push --tags
65-
66- rm -fr build dist
67- python -m sphinx -M html ./docs ./build/sphinx
68- python -m pipx run build
69- twine upload dist/*
You can’t perform that action at this time.
0 commit comments