File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Publish to PyPI
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ tags :
7+ - ' v*' # Push events to matching v*, i.e. v1.0, v20.15.10
8+
9+ jobs :
10+ build-and-publish :
11+ name : Build and publish to PyPI
12+ runs-on : ubuntu-latest
13+
14+ steps :
15+ - uses : actions/checkout@v3
16+
17+ - name : Set up Python
18+ uses : actions/setup-python@v4
19+ with :
20+ python-version : ' 3.x'
21+
22+ - name : Install dependencies
23+ run : |
24+ python -m pip install --upgrade pip
25+ pip install build twine
26+
27+ - name : Build package
28+ run : python -m build
29+
30+ - name : Publish to PyPI
31+ if : startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'
32+ uses : pypa/gh-action-pypi-publish@release/v1
33+ with :
34+ password : ${{ secrets.PYPI_API_TOKEN }}
Original file line number Diff line number Diff line change @@ -173,4 +173,7 @@ aws.credentials
173173# Testing CSV files
174174* .csv
175175* .json
176- * .json.gz
176+ * .json.gz
177+
178+ # Don't ignore GitHub workflows
179+ ! .github /workflows /
You can’t perform that action at this time.
0 commit comments