-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (44 loc) · 1.25 KB
/
test-pub.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
name: Test, Build and Publish
on:
push:
paths:
- "src/**"
- "poetry.lock"
- ".github/workflows/test-pub.yml"
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- run: pipx install poetry
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: poetry
- name: Install and Test
run: |
poetry install -n -vv
poetry run pytest tests
publish:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- name: Install Poetry and Publish to PyPI
id: publish
run: |
pipx install poetry
echo "version=$(poetry version -s)" >> $GITHUB_OUTPUT
export POETRY_PYPI_TOKEN_PYPI=${{ secrets.PYPI_TOKEN }}
poetry publish -n --build
- uses: softprops/action-gh-release@v1
with:
files: dist/*
prerelease: ${{ startsWith(github.head_ref, 'dev') }}
tag_name: ${{ steps.publish.outputs.version }}
name: ${{ steps.publish.outputs.version }}
generate_release_notes: true