Skip to content

Commit 7843dcf

Browse files
committed
try a publish workflow
1 parent e0f4d33 commit 7843dcf

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
on: [push, pull_request]
2+
3+
jobs:
4+
publish:
5+
name: build and publish to pypi
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
10+
- name: Set up Python
11+
uses: actions/setup-python@v1
12+
with:
13+
python-version: 3.9
14+
15+
- name: install dependencies & build
16+
run: |
17+
pip3 install setuptools build wheel
18+
python3 setup.py sdist bdist_wheel
19+
20+
- name: publish to Test PyPi
21+
uses: pypa/gh-action-pypi-publish@release/v1
22+
with:
23+
skip_existing: true
24+
user: __token__
25+
password: ${{ secrets.TEST_PYPI_TOKEN }}
26+
repository_url: https://test.pypi.org/legacy/
27+
28+
- name: publish to PyPi
29+
if: startsWith(github.ref, 'refs/tags')
30+
uses: pypa/gh-action-pypi-publish@release/v1
31+
with:
32+
user: __token__
33+
password: ${{ secrets.PYPI_TOKEN }}

0 commit comments

Comments
 (0)