-
Notifications
You must be signed in to change notification settings - Fork 64
99 lines (85 loc) · 2.58 KB
/
build_wheels_and_publish.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
94
95
96
97
98
99
name: Build wheel and publish
on:
release:
types: [published]
workflow_dispatch:
env:
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-*"
CIBW_SKIP: "*-win32 *musllinux*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_BEFORE_BUILD: pip install numpy --config-settings=setup-args="-Dallow-noblas=true"
jobs:
build-wheels:
name: Build ${{ matrix.python-version }} wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: "3.7"
- name: Setup Mac
if: runner.os == 'macOS'
run: |
python -m pip install numpy h5py versioneer
sudo ln -s /usr/local/bin/gfortran-11 /usr/local/bin/gfortran
sudo mkdir /usr/local/gfortran
sudo ln -s /usr/local/Cellar/gcc@9/9.3.0_1/lib/gcc/9 /usr/local/gfortran/lib
- name: Setup Linux
if: runner.os == 'Linux'
run: |
python -m pip install numpy h5py versioneer
- name: Build wheels
run: |
python -m pip install cibuildwheel
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build-source-dist:
name: Build source dist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: "3.7"
- name: Build dist
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine numpy
python setup.py sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
publish:
needs: [build-wheels, build-source-dist]
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Download builds
uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_password }}