-
Notifications
You must be signed in to change notification settings - Fork 28
56 lines (53 loc) · 1.34 KB
/
python-package.yml
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
name: Build
on:
push:
branches:
- develop
pull_request:
branches:
- develop
release:
types:
- published
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- 3.7
- 3.8
- 3.9
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -r requirements-dev.txt
- name: Test with pytest
run: |
flake8
pytest --verbose --cov-config setup.cfg
release:
needs: tests
if: github.event_name == 'release' && github.event.action == 'published'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
pip install wheel twine
export PACKAGE_VERSION=${GITHUB_REF:10}
echo "__version__ = '$PACKAGE_VERSION'" > sevenbridges/version.py
python setup.py sdist bdist_wheel
twine upload dist/*