Skip to content

Test / Release

Test / Release #10

Workflow file for this run

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/*