|
9 | 9 | runs-on: ubuntu-latest
|
10 | 10 | strategy:
|
11 | 11 | matrix:
|
12 |
| - python-version: [ 3.6, 3.7, 3.8 ] |
| 12 | + python-version: [ 3.7, 3.8 ] |
13 | 13 | steps:
|
14 | 14 | - uses: actions/checkout@v2
|
15 | 15 | - name: Set up Python ${{ matrix.python-version }}
|
16 | 16 | uses: actions/setup-python@v2
|
17 | 17 | with:
|
18 | 18 | python-version: ${{ matrix.python-version }}
|
19 | 19 |
|
20 |
| - - name: Patch for Python 3.6 |
21 |
| - if: matrix.python-version == 3.6 |
| 20 | + - name: Install dependencies |
22 | 21 | run: |
|
23 |
| - pip install strip-hints==0.1.9 |
24 |
| - ./patch-python3.6.sh |
| 22 | + curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python |
| 23 | + source $HOME/.poetry/env |
| 24 | + poetry install |
25 | 25 |
|
26 |
| - git config --global user.email "[email protected]" |
27 |
| - git config --global user.name "Github Actions" |
| 26 | + - name: Run tests |
| 27 | + run: | |
| 28 | + source $HOME/.poetry/env |
| 29 | + poetry run pytest |
28 | 30 |
|
29 |
| - git add --all |
30 |
| - git commit --message "Python 3.6 patch" |
31 |
| - latest_tag=$(git describe --abbrev=0 --tags) |
32 |
| - git tag --force ${latest_tag} |
| 31 | + - name: Build wheels |
| 32 | + run: | |
| 33 | + source $HOME/.poetry/env |
| 34 | + poetry version $(git tag --points-at HEAD) |
| 35 | + poetry build |
33 | 36 |
|
34 |
| - - name: Install dependencies |
| 37 | + - name: Upload |
| 38 | + env: |
| 39 | + USERNAME: __token__ |
| 40 | + PASSWORD: ${{ secrets.PYPI_TOKEN }} |
35 | 41 | run: |
|
36 |
| - pip install -r requirements.txt |
| 42 | + source $HOME/.poetry/env |
| 43 | + poetry publish --username=$USERNAME --password=$PASSWORD |
| 44 | +
|
| 45 | +
|
| 46 | +
|
| 47 | +name: Publish |
| 48 | + |
| 49 | +on: |
| 50 | + release: |
| 51 | + types: [created] |
37 | 52 |
|
38 |
| - - name: Install dev dependencies |
| 53 | +jobs: |
| 54 | + build: |
| 55 | + runs-on: ubuntu-latest |
| 56 | + strategy: |
| 57 | + matrix: |
| 58 | + python-version: [ 3.7, 3.8 ] |
| 59 | + steps: |
| 60 | + - uses: actions/checkout@v2 |
| 61 | + - name: Set up Python ${{ matrix.python-version }} |
| 62 | + uses: actions/setup-python@v2 |
| 63 | + with: |
| 64 | + python-version: ${{ matrix.python-version }} |
| 65 | + |
| 66 | + - name: Install dependencies |
39 | 67 | run: |
|
40 |
| - pip install -r dev_requirements.txt |
| 68 | + curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python |
| 69 | + source $HOME/.poetry/env |
| 70 | + poetry install |
41 | 71 |
|
42 |
| - - name: Test |
| 72 | + - name: Run tests |
43 | 73 | run: |
|
44 |
| - pytest |
| 74 | + source $HOME/.poetry/env |
| 75 | + poetry run pytest |
45 | 76 |
|
46 |
| - - name: Test install package |
47 |
| - env: |
48 |
| - PYTHON_VERSION: ${{ matrix.python-version }} |
| 77 | + - name: Build wheels |
49 | 78 | run: |
|
50 |
| - python setup.py bdist_wheel --python-tag py${PYTHON_VERSION//.} |
| 79 | + source $HOME/.poetry/env |
| 80 | + poetry version $(git tag --points-at HEAD) |
| 81 | + poetry build |
51 | 82 |
|
52 | 83 | - name: Test install package
|
53 | 84 | run: |
|
54 |
| - pip install virtualenv |
55 |
| - virtualenv installable |
56 |
| - source installable/bin/activate |
57 |
| -
|
58 |
| - pip install dist/$(ls dist) |
59 |
| -
|
| 85 | + source $HOME/.poetry/env |
60 | 86 | mkdir test_install
|
61 | 87 | cd test_install
|
62 |
| - python -c "import datastream" |
| 88 | + poetry init |
| 89 | + poetry add ../dist/$(ls dist/*.whl) |
| 90 | + |
| 91 | + poetry run python -c "import datastream" |
63 | 92 |
|
64 |
| - - name: PyPi Publish |
| 93 | + - name: Upload |
65 | 94 | env:
|
66 |
| - TWINE_USERNAME: __token__ |
67 |
| - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} |
68 |
| - run: |
69 |
| - twine upload dist/* |
| 95 | + USERNAME: __token__ |
| 96 | + PASSWORD: ${{ secrets.PYPI_TOKEN }} |
| 97 | + run: | |
| 98 | + source $HOME/.poetry/env |
| 99 | + poetry publish --username=$USERNAME --password=$PASSWORD |
0 commit comments