Skip to content

Commit 7394651

Browse files
committed
Add GitHub action to publish to PyPI
1 parent 669c965 commit 7394651

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [released, prereleased]
6+
7+
permissions:
8+
contents: read # to fetch code (actions/checkout)
9+
10+
jobs:
11+
build_and_publish:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Set up Python 3.8
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.8'
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
python -m pip install wheel
27+
- name: Build
28+
run: python setup.py sdist bdist_wheel
29+
30+
- name: Publish to PyPI
31+
uses: pypa/gh-action-pypi-publish@release/v1
32+
with:
33+
user: '__token__'
34+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)