-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (47 loc) · 1.21 KB
/
ci.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 / Release
on:
push:
branches: [ "main" ]
tags: [ "v**" ]
pull_request:
branches: [ "**" ]
workflow_dispatch:
env:
python-version: 3.11.6
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.python-version }}
cache: 'pip'
- name: Install juq
run: pip install -e .[test]
- name: Setup test
run: python -m ipykernel install --user --name python3
- name: Run tests
run: pytest -v
release:
name: Release
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.python-version }}
cache: 'pip'
- name: Install release deps
run: pip install setuptools twine wheel
- name: Install juq
run: pip install -e .
- name: Build release
run: python setup.py sdist bdist_wheel
- name: Publish release
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: twine upload dist/*