-
Notifications
You must be signed in to change notification settings - Fork 25
44 lines (38 loc) · 912 Bytes
/
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
name: Run tests and publish
on:
pull_request:
push:
branches:
- main
tags:
- 'v*.*.*'
jobs:
checks:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install poetry dependencies
run: |
pip install poetry
poetry config virtualenvs.create false
poetry install
- name: Run tests
run: |
poetry run python -m unittest discover
release:
name: Release
runs-on: ubuntu-latest
needs: [checks]
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- name: Build and publish to pypi
uses: JRubics/[email protected]
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
python_version: 3.9