Skip to content

Commit b06626b

Browse files
committed
improve ci
1 parent bfe2ee0 commit b06626b

File tree

2 files changed

+40
-45
lines changed

2 files changed

+40
-45
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
pull_request:
66

77
jobs:
8-
build:
8+
test:
99
runs-on: ubuntu-20.04
1010
name: "python ${{ matrix.python-version }} ${{ matrix.toxenv }}"
1111
strategy:
@@ -50,3 +50,42 @@ jobs:
5050
- uses: codecov/codecov-action@v1
5151
with:
5252
env_vars: OS,PYTHON,TOXENV
53+
54+
publish:
55+
name: Build and publish Python distributions to PyPI and TestPyPI
56+
needs:
57+
- test
58+
runs-on: ubuntu-18.04
59+
steps:
60+
- uses: actions/checkout@master
61+
- name: Set up Python 3.7
62+
uses: actions/setup-python@v1
63+
with:
64+
python-version: 3.7
65+
- name: Install pypa/build
66+
run: >-
67+
python -m
68+
pip install
69+
build
70+
--user
71+
- name: Build a binary wheel and a source tarball
72+
run: >-
73+
python -m
74+
build
75+
--sdist
76+
--wheel
77+
--outdir dist/
78+
- name: Publish distribution to Test PyPI
79+
if: github.ref == 'refs/heads/master'
80+
uses: pypa/gh-action-pypi-publish@master
81+
with:
82+
skip_existing: true
83+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
84+
repository_url: https://test.pypi.org/legacy/
85+
86+
- name: Publish distribution to PyPI
87+
if: startsWith(github.ref, 'refs/tags')
88+
uses: pypa/gh-action-pypi-publish@master
89+
with:
90+
skip_existing: true
91+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/pypi.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)