-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.3 KB
/
test_deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Test and deploy
on:
push:
release:
types: [published]
jobs:
test:
name: Test with Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.7"
- "3.8"
- "3.x"
steps:
- uses: actions/checkout@v1
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --upgrade pipenv
pipenv install --dev --deploy
pipenv run pip install --upgrade importlib_metadata
- name: Run tests
run: pipenv run tests
deploy:
# only deploy on release
if: github.event_name == 'release'
name: Deploy
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Python
uses: actions/setup-python@v1
- name: Install dependencies
run: |
pip install -U pipenv
pipenv install --dev --deploy
- name: Build distribution
run: pipenv run build
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}