-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (49 loc) · 1.51 KB
/
publish.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
name: Upload Package
on:
release:
types: [created]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.6
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Cache python environment
id: cache-env
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-testing-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
- name: Install poetry
if: steps.cache-env.outputs.cache-hit != 'true'
run: |
pip install poetry==1.1.5
- name: Setup poetry environment
id: setup-poetry-env
run: |
poetry env use $(which python)
echo "::set-output name=poetry-env::$(poetry env info --path)"
- name: Cache poetry environment
id: cache-poetry
uses: actions/cache@v2
with:
path: ${{ steps.setup-poetry-env.outputs.poetry-env }}
key: ${{ runner.os }}-poetry-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: |
poetry install
- name: Sanity check (run tests)
run: |
poetry run pytest
- name: Build package
run: |
poetry build
- name: Publish package
env:
POETRY_PYPI_TOKEN_PYPI: ${{secrets.pypi_upload}}
run: |
poetry publish