-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (58 loc) · 2.16 KB
/
pythonpublish.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
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Upload Python Package
on:
push:
tags:
- '*.*.*'
jobs:
deploy:
strategy:
matrix:
runs-on: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
if: matrix.runs-on == 'windows-latest' || (matrix.runs-on == 'ubuntu-latest') || (matrix.runs-on == 'macos-latest')
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade setuptools wheel twine
python3 -m pip install -r ci_requirements.txt
- name: Upload source code
if: matrix.runs-on == 'ubuntu-latest' && matrix.python-version == '3.12'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python3 setup.py sdist
python3 -m twine upload dist/*.tar.gz
- name: Build Windows or MAC-OS Python wheels
if: matrix.runs-on == 'windows-latest' || matrix.runs-on == 'macos-latest'
run: |
python3 setup.py sdist bdist_wheel
- name: Publish Windows or MAC-OS Python wheels
if: matrix.runs-on == 'windows-latest' || matrix.runs-on == 'macos-latest'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python3 -m twine upload dist/*.whl
- name: Build Linux Python wheels, install cibuildwheel
if: matrix.runs-on == 'ubuntu-latest' && matrix.python-version == '3.12'
run: |
python -m pip install cibuildwheel==2.16.5
- name: Build Linux Python wheels
if: matrix.runs-on == 'ubuntu-latest' && matrix.python-version == '3.12'
run: |
python -m cibuildwheel --output-dir dist
- name: Publish Linux Python wheels
if: matrix.runs-on == 'ubuntu-latest' && matrix.python-version == '3.12'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python3 -m twine upload dist/*linux*.whl