-
Notifications
You must be signed in to change notification settings - Fork 46
95 lines (94 loc) · 3.36 KB
/
build_x86_mac_wheels.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
name: Build and Publish Wheels (Mac OSX x86_64 only)
on:
workflow_dispatch:
release:
types: [published]
jobs:
build-mac:
name: Mac OSX Python ${{ matrix.python-version }} - Build Wheels
runs-on: macos-12
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
include:
- python-version: "3.8"
PYTHON_VERSION_CODE: cp38-cp38
PYTHON_VERSION_NUMBER: "3.8"
- python-version: "3.9"
PYTHON_VERSION_CODE: cp39-cp39
PYTHON_VERSION_NUMBER: "3.9"
- python-version: "3.10"
PYTHON_VERSION_CODE: cp310-cp310
PYTHON_VERSION_NUMBER: "3.10"
- python-version: "3.11"
PYTHON_VERSION_CODE: cp311-cp311
PYTHON_VERSION_NUMBER: "3.11"
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Select Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: "x64" # optional x64 or x86. Defaults to x64 if not specified
- name: Set variables
run: |
VER=$(cat ./VERSION.txt)
echo "VERSION=$VER"
echo "VERSION=$VER" >> $GITHUB_ENV
- name: Test environment
run: |
echo "VERSION=${{ env.VERSION }}"
echo "PYTHON_VERSION_CODE=${{ matrix.PYTHON_VERSION_CODE }}"
echo "PYTHON_VERSION_NUMBER=${{ matrix.PYTHON_VERSION_NUMBER }}"
- name: Install pytest, wheel, auditwheel, pybind11-stubgen, numpy and torch
run: python -m pip install pytest wheel auditwheel numpy torch
- name: Install dependencies
run: ci/mac/install_dependencies.sh
- name: Build wheel
run: |
cd ci/mac
./build_wheels_x86_64.sh
env:
PYTHON: ${{ matrix.PYTHON }}
ARCHFLAGS: "-arch x86_64"
CFLAGS: "-arch x86_64"
CXXFLAGS: "-arch x86_64"
_PYTHON_HOST_PLATFORM: "macosx-10.9-x86_64"
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION_CODE }}
PYTHON_VERSION_NUMBER: ${{ matrix.PYTHON_VERSION_NUMBER }}
DYLD_PRINT_LIBRARIES: 1
- name: Publish artifact
uses: actions/upload-artifact@v3
with:
name: nimblephysics-${{ env.VERSION }}-${{ matrix.PYTHON_VERSION_CODE }}-macosx_12_0_x86_64.whl
path: wheelhouse/nimblephysics-${{ env.VERSION }}-${{ matrix.PYTHON_VERSION_CODE }}-macosx_12_0_x86_64.whl
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [build-mac]
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: wheelhouse
- name: Display structure of downloaded files before flattening
run: ls -R
working-directory: wheelhouse
- name: Flatten files
run: |
mkdir wheelhouse2
find wheelhouse -type f -exec mv {} wheelhouse2 \;
rm -rf wheelhouse
mv wheelhouse2 wheelhouse
- name: Display structure of downloaded files after flattening
run: ls -R
working-directory: wheelhouse
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1.8
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: wheelhouse/
skip_existing: true
verbose: true