-
Notifications
You must be signed in to change notification settings - Fork 2
90 lines (70 loc) · 2.49 KB
/
main.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: build CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8"]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip And setuptools
run: python -m pip install -U pip setuptools pipenv
- name: Checkout workspace
uses: actions/checkout@v2
- name: Install Poetry
shell: bash
run: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Test Poetry Install
run: poetry --version
- name: Configure poetry
shell: bash
run: poetry config virtualenvs.in-project false
- name: Install Python Dependencies
run: poetry install -E testing
- name: Run complete test suite
run: poetry run py.test -s -vvv --flake8 packratt/
deploy:
needs: test
runs-on: ubuntu-latest
if: >
github.event_name == 'push' &&
(startsWith(github.event.ref, 'refs/tags') ||
github.event.ref == 'refs/heads/master')
steps:
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install latest setuptools, wheel, pip
run: python3 -m pip install -U pip setuptools wheel
- name: Install dephell
run: curl -L dephell.org/install | python3
- name: Checkout source
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Convert pyproject.toml to setup.py
run: dephell deps convert --from=pyproject.toml --to=setup.py
- name: Build distributions
run: python setup.py sdist bdist_wheel
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.test_pypi_token }}
repository_url: https://test.pypi.org/legacy/
continue-on-error: true
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
with:
user: __token__
password: ${{ secrets.pypi_token }}