-
Notifications
You must be signed in to change notification settings - Fork 2
99 lines (88 loc) · 2.79 KB
/
build_pip.yml
File metadata and controls
99 lines (88 loc) · 2.79 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
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
94
95
96
97
98
99
name: Build PIP packages
on:
release:
types: [created, edited]
workflow_dispatch:
jobs:
deploy_source:
runs-on: 'macos-latest'
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build source distribution
run: |
python -m build --sdist
- name: Publish source distribution
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload --skip-existing dist/*.tar.gz
deploy_wheel_mac:
needs: deploy_source #don't build wheels unless we successfully built source package.
strategy:
matrix:
os: [macos-latest] #, ubuntu-latest]
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
arch: [x86_64, arm64]
exclude:
- os: windows-latest
arch: arm64
- os: ubuntu-latest
arch: arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build wheel
shell: bash
run: |
if [[ "${{ matrix.os }}" == "macos-latest" ]]; then
arch -${{ matrix.arch }} python -m build --wheel
else
python -m build --wheel
fi
- name: Publish wheel
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload --skip-existing dist/*.whl
deploy_wheel_win:
needs: deploy_source #don't build wheels unless we successfully built source package.
strategy:
matrix:
os: [windows-latest]
python: ['3.9', '3.10', '3.11', '3.12', '3.13'] #,2.7] - # 2.7 disabled for now due to missing VC9
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
conda install wheel twine cython numpy pyyaml libpython m2w64-toolchain
python -m pip install --upgrade build meson meson-python
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m build --wheel --no-isolation -Csetup-args="--native-file=mingw_native.ini"
twine upload --skip-existing dist/*