-
Notifications
You must be signed in to change notification settings - Fork 17
57 lines (55 loc) · 1.51 KB
/
publish.yml
File metadata and controls
57 lines (55 loc) · 1.51 KB
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: Upload Python Package
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
python: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12']
urllib3-line: ["lt2", "ge2"]
exclude:
- python: "3.7"
urllib3-line: "ge2"
- python: "3.8"
urllib3-line: "ge2"
steps:
- uses: actions/checkout@v5
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install deps
run: |
pip install -r requirements/requirements.txt
if [ "${{ matrix.urllib3-line }}" = "lt2" ]; then
pip install "urllib3<2"
else
pip install "urllib3!=2.0.0,<3"
fi
pip install -e .
- name: Install Tox and any other packages
run: |
python -m pip install --upgrade pip
pip install -r requirements/test.txt
- name: Run Tox
run: tox -e py
release:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install build dependencies
run: |
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*