Skip to content

chore: prepare 0.7.0 release (#101) #440

chore: prepare 0.7.0 release (#101)

chore: prepare 0.7.0 release (#101) #440

Workflow file for this run

name: Wheels
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
tags:
- 'v*'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Checkout specific submodules
run: |
cd ext_libs/vowpal_wabbit
git submodule update --init ext_libs/armadillo-code
git submodule update --init ext_libs/ensmallen
- name: Build SDist
run: pipx run build --sdist
- name: Check metadata
run: pipx run twine check dist/*
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
build_wheels_linux_x64:
name: ${{ matrix.os }} x86_64 ${{matrix.cibw_python}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
cibw_python: [ "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*"]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Checkout specific submodules
run: |
cd ext_libs/vowpal_wabbit
git submodule update --init ext_libs/armadillo-code
git submodule update --init ext_libs/ensmallen
- uses: pypa/cibuildwheel@v2.16.2
env:
CIBW_BUILD: ${{ matrix.cibw_python }}
CIBW_ARCHS: x86_64
CIBW_ENVIRONMENT_LINUX: CMAKE_TOOLCHAIN_FILE=/project/ext_libs/vcpkg/scripts/buildsystems/vcpkg.cmake
# Need to get things ready before we can use vcpkg.
CIBW_BEFORE_ALL_LINUX: yum install -y curl zip unzip tar && /project/ext_libs/vcpkg/bootstrap-vcpkg.sh
- uses: actions/upload-artifact@v3
with:
path: wheelhouse/*.whl
build_wheels_windows_x64:
name: ${{ matrix.os }} x86_64 ${{matrix.cibw_python}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
cibw_python: [ "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*"]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Checkout specific submodules
run: |
cd ext_libs/vowpal_wabbit
git submodule update --init ext_libs/armadillo-code
git submodule update --init ext_libs/ensmallen
- id: change-path
run: python -c "import pathlib;print('UNIX_PATH='+str(pathlib.PureWindowsPath(r'${{github.workspace}}').as_posix()))" >> $env:GITHUB_OUTPUT
- uses: pypa/cibuildwheel@v2.16.2
env:
CIBW_BUILD: ${{ matrix.cibw_python }}
CIBW_ARCHS: AMD64
CIBW_ENVIRONMENT_WINDOWS: VCPKG_FORCE_DOWNLOADED_BINARIES=true CMAKE_TOOLCHAIN_FILE=${{ steps.change-path.outputs.UNIX_PATH }}/ext_libs/vcpkg/scripts/buildsystems/vcpkg.cmake SKBUILD_CONFIGURE_OPTIONS='-DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded'
- uses: actions/upload-artifact@v3
with:
path: wheelhouse/*.whl
build_wheels_macos_universal2:
name: ${{ matrix.os }} universal2 ${{matrix.cibw_python}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest]
cibw_python: [ "cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*"]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
# We use full vendoring for this since we need to cross compile the ARM piece.
- uses: pypa/cibuildwheel@v2.16.2
env:
CIBW_BUILD: ${{ matrix.cibw_python }}
CIBW_ARCHS_MACOS: universal2
CIBW_ENVIRONMENT_MACOS: SKBUILD_CONFIGURE_OPTIONS='-DVW_NEXT_VENDOR_ALL=ON' MACOSX_DEPLOYMENT_TARGET=10.13
- uses: actions/upload-artifact@v3
with:
path: wheelhouse/*.whl
check_wheels:
name: Check wheels
needs: [build_wheels_linux_x64, build_wheels_windows_x64, build_wheels_macos_universal2, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install twine
run: pip install twine
- name: Check wheels
run: twine check dist/*
deploy_to_test:
name: Upload if release (test)
environment: "Test-PyPi"
needs: [check_wheels]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@v1.6.4
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
deploy_to_prod:
name: Upload if release (prod)
environment: "Prod-PyPi"
needs: [deploy_to_test]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@v1.6.4
with:
password: ${{ secrets.PYPI_API_TOKEN }}