-
Notifications
You must be signed in to change notification settings - Fork 539
57 lines (54 loc) · 1.53 KB
/
publish-pypi.yaml
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
49
50
51
52
53
54
55
56
57
name: Run tests & Publish Python 🐍 distributions 📦 to PyPI
on:
push:
tags:
- '*'
jobs:
tests-ci:
strategy:
fail-fast: false
matrix:
# you have to quote any version number ending in a 0 or gh truncates it. ie 3.10 turned into 3.1
python-version: [ 3.8, '3.10', 3.11, 3.12 ]
os: [ ubuntu-latest ] #in the future we should add windows here
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: pip install
run: |
pip install -r requirements/requirements.txt
pip install -r requirements/requirements_test.txt
- name: run tests
run: pytest .
build-n-publish:
name: Build the 🐍 package and push PyPI
runs-on: ubuntu-latest
needs: tests-ci
steps:
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.11
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}