-
Notifications
You must be signed in to change notification settings - Fork 2
66 lines (63 loc) · 1.8 KB
/
test_and_release.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
name: Run tests, deploy tagged releases
on:
push:
jobs:
tests:
name: Run tests
strategy:
fail-fast: false
matrix:
python-version: [3.7]
poetry-version: [1.4.2]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/[email protected]
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Run tests
run: |
poetry install
poetry run pytest
deployment:
name: Deploy a new release to Pypi
if: ${{ startsWith(github.ref, 'refs/tags/') }} # only on tagged commits
needs: tests
strategy:
matrix:
python-version: [3.7]
poetry-version: [1.4.2]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: abatilo/[email protected]
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Publish package
run: |
poetry install
poetry version ${{ github.event.release.tag_name }}
poetry publish --build --username __token__ --password ${{ secrets.PYPI_API_TOKEN }}
# release:
# name: Create a new release on github
# needs: deployment
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref }}
# release_name: Release ${{ github.ref }}
# draft: true
# body: |
# Summary:
# - TODO