Changed artifact to v4 #272
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: [push, pull_request] | |
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 | |
with: | |
submodules: 'recursive' | |
- name: Add msbuild to PATH | |
uses: microsoft/[email protected] | |
if: startsWith(matrix.os,'windows') | |
- name: Add Windows SDK | |
shell: cmd | |
if: startsWith(matrix.os,'windows') | |
run: | | |
choco install windows-sdk-8.1 | |
- uses: actions/setup-python@v2 | |
name: Install Python | |
with: | |
python-version: '3.9' | |
- name: Build wheels | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade build | |
python -m pip install cibuildwheel | |
python -m cibuildwheel --output-dir wheelhouse | |
env: | |
CIBW_BUILD: "cp3*" | |
# Skip testing on arm64 Python 3.8 because it uses the x86_64 executable, not the arm executable | |
CIBW_TEST_SKIP: "cp38-macosx_*:arm64" | |
# Clean the build directory between builds | |
CIBW_BEFORE_BUILD: >- | |
rm -rf {package}/osqp_sources/build | |
CIBW_ENVIRONMENT_LINUX: CMAKE_GENERATOR="Unix Makefiles" | |
CIBW_ENVIRONMENT_MACOS: CMAKE_GENERATOR="Unix Makefiles" CMAKE_OSX_ARCHITECTURES=${{ matrix.osx_arch }} | |
CIBW_ENVIRONMENT_WINDOWS: CMAKE_GENERATOR="Visual Studio 17 2022" CMAKE_GENERATOR_PLATFORM=x64 | |
CIBW_BUILD_VERBOSITY: 1 | |
CIBW_TEST_EXTRAS: dev | |
- name: Build source | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
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_password }} | |
run: | | |
python -m pip install --upgrade twine | |
twine upload wheelhouse/* | |
- name: Upload artifacts to github | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels | |
path: ./wheelhouse |