-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (63 loc) · 2.21 KB
/
build_and_upload.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
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Build and Upload Wheels
on:
push:
branches: [ master ] # Change as needed
workflow_dispatch:
jobs:
build_wheels:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false #build all wheels even if one fails
matrix:
include:
- os: ubuntu-latest
python-version: "3.9"
cpython-tag: "cp39"
- os: ubuntu-latest
python-version: "3.10"
cpython-tag: "cp310"
- os: ubuntu-latest
python-version: "3.11"
cpython-tag: "cp311"
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
# Conditional step: install additional dependencies only for Python 3.9
- name: Install specific dependencies for Python 3.9
if: matrix.python-version == '3.9'
run: |
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install -y python3.9 python3.9-dev python3.9-venv
- name: Install cibuildwheel
run: |
python -m pip install --upgrade pip
pip install cibuildwheel==2.12.0
- name: Build wheels with cibuildwheel
env:
CIBW_BUILD: ${{ matrix.cpython-tag }}-*
CIBW_SKIP: pp*,jy*,cp27*,cp36*,cp37*,cp38*
run: |
cibuildwheel --output-dir wheelhouse
- name: Install Twine for Upload
run: python -m pip install twine
- name: Upload to TestPyPI with Twine (verbose)
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload --verbose --repository-url https://test.pypi.org/legacy/ wheelhouse/*
# - name: Upload to TestPyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.PYPI_API_TOKEN }}
# repository_url: https://test.pypi.org/legacy/
# packages_dir: wheelhouse