-
Notifications
You must be signed in to change notification settings - Fork 6
47 lines (42 loc) · 1.11 KB
/
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
45
46
47
name: main
on: [push, pull_request]
permissions:
contents: read
concurrency:
group: main-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v3
with:
python-version: 3.10.2
- name: Install
shell: bash -l {0}
run: |
python -m pip install -e ".[test]"
- name: Test
shell: bash -l {0}
run: |
python -m pytest
deploy:
runs-on: ubuntu-20.04
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
environment: PyPi-deploy
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v3
with:
python-version: 3.10.2
- name: Install requirements and build wheel
shell: bash -l {0}
run: |
python -m pip install build twine
python -m build .
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}