-
Notifications
You must be signed in to change notification settings - Fork 5
93 lines (72 loc) · 2.31 KB
/
main.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Deploy
on: push
jobs:
build-win:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022]
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@master
with:
python-version: 3.8 # Usa la versione 3.8 per migliore compatibilità su Windows
- name: Set cibuildwheel options
shell: pwsh
run: |
$env:CIBW_SKIP="cp37-win32" # Salta CPython 3.7 32 bit su Windows
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
run: python -m cibuildwheel --output-dir dist
- uses: actions/upload-artifact@master
with:
name: windows-wheel
path: dist/*.whl
- name: Check artifact files
run: ls dist/*.whl || echo "No wheels found in dist/"
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Build manylinux Python wheels
uses: RalfG/python-wheels-manylinux-build@v0.4.2-manylinux2014_x86_64
with:
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312'
- uses: actions/upload-artifact@master
with:
name: linux-wheel
path: dist/*-manylinux*.whl
deploy-pypi:
runs-on: ubuntu-latest
needs: [build-linux, build-win]
if: github.ref == 'refs/heads/master' # We only deploy on master commits
steps:
- name: Checkout repo
uses: actions/checkout@master
with:
fetch-depth: 0
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- uses: actions/download-artifact@master
with:
name: linux-wheel
path: dist
- uses: actions/download-artifact@master
with:
name: windows-wheel
path: dist
- run: ls dist
- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}