-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (39 loc) · 1008 Bytes
/
deploy.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
name: Test and Deploy
on:
push:
branches:
- main
permissions:
contents: read
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- name: prep action
uses: actions/checkout@v4
- name: filter changes
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
project:
- 'pyproject.toml'
- name: setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Run Tests
run: |
pip install --upgrade pip
pip install -e ".[dev]"
pytest tests/
- name: Build a binary wheel
if: steps.changes.outputs.project == 'true'
run: |
pip install --upgrade build
python -m build
- name: Publish to PyPI
if: steps.changes.outputs.project == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}