-
Notifications
You must be signed in to change notification settings - Fork 36
78 lines (68 loc) · 2.1 KB
/
build_default.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
name: Build Default
on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master
jobs:
build_wheels:
name: Build wheel on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Include macos-13 to get Intel x86_64 macs and maos-latest to get the Aaarch64 macs
os: [ubuntu-latest, macos-latest, macos-13, windows-2022]
# Build on the native architectures (macos-latest is arm64. macos-13 is x86_64)
include:
- os: macos-latest
osx_arch: 'arm64'
- os: macos-13
osx_arch: 'x86_64'
steps:
- uses: actions/checkout@master
- name: Build wheels
uses: pypa/cibuildwheel@v2.17
with:
output-dir: wheelhouse
env:
CIBW_BUILD: "cp3?-*"
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux_*"
CIBW_TEST_REQUIRES: setuptools pytest torch numdifftools
CIBW_TEST_COMMAND: "python -m pytest -s {project}/src/osqp/tests -k \"not codegen\""
CIBW_ENVIRONMENT_MACOS: CMAKE_OSX_ARCHITECTURES=${{ matrix.osx_arch }}
CIBW_BUILD_VERBOSITY: 1
- name: Build source
if: runner.os == 'Linux'
run: |
python -m pip install --upgrade build
python -m build --sdist --outdir wheelhouse
- name: Release to pypi
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
TWINE_REPOSITORY: testpypi
run: |
python -m pip install --upgrade twine
twine upload wheelhouse/*
- name: Upload artifacts to github
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: ./wheelhouse
merge_wheels:
name: Merge wheel artifacts from build_wheels OS matrix jobs
runs-on: ubuntu-latest
needs: build_wheels
steps:
- name: Merge artifacts
uses: actions/upload-artifact/merge@v4
with:
name: wheels
pattern: wheels-*
delete-merged: true