digaws/.github/workflows/main.yml

65 lines
1.4 KiB
YAML
Raw Permalink Normal View History

2020-12-25 20:36:41 +00:00
name: CI
on:
push:
branches:
- main
2020-12-26 15:58:53 +00:00
tags:
- '*'
2020-12-25 20:36:41 +00:00
pull_request:
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
2024-03-22 15:49:17 +00:00
python-version: ["3.8", "3.9", "3.10", "3.11"]
2020-12-25 20:36:41 +00:00
steps:
2024-03-22 15:52:30 +00:00
- uses: actions/checkout@v4
2020-12-25 20:36:41 +00:00
- name: Set up Python ${{ matrix.python-version }}
2024-03-22 15:52:30 +00:00
uses: actions/setup-python@v5
2020-12-25 20:36:41 +00:00
with:
python-version: ${{ matrix.python-version }}
- name: Install nox
run: |
python -m pip install --upgrade pip
pip install nox
- name: Lint and typing
run: |
nox -rs lint typing
- name: Tests
run: |
nox -rs tests -- -v
build_publish:
runs-on: ubuntu-latest
2020-12-26 18:00:42 +00:00
needs: tests
2020-12-26 11:35:13 +00:00
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
2020-12-25 20:36:41 +00:00
steps:
2024-03-22 15:52:30 +00:00
- uses: actions/checkout@v4
2020-12-25 20:36:41 +00:00
2023-06-24 09:57:53 +00:00
- name: Set up Python 3.11
2024-03-22 15:52:30 +00:00
uses: actions/setup-python@v5
2020-12-25 20:36:41 +00:00
with:
2023-06-24 09:57:53 +00:00
python-version: 3.11
2020-12-25 20:36:41 +00:00
- name: Install tools
run: |
python -m pip install --upgrade pip
2020-12-26 11:35:13 +00:00
pip install twine wheel
2020-12-25 20:36:41 +00:00
- name: Build
run: |
python setup.py sdist bdist_wheel
- name: Publish
run: |
export TWINE_USERNAME=${{ secrets.TWINE_USERNAME }}
export TWINE_PASSWORD=${{ secrets.TWINE_PASSWORD }}
twine upload dist/*