Fix for aspherical surfaces (#172) #56
Workflow file for this run
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 and Publish Wheel | |
on: | |
push: | |
tags: 'v*.*.*' | |
jobs: | |
build_wheels: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ['3.9', '3.10', '3.11', '3.12'] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install cibuildwheel | |
run: pip install cibuildwheel | |
# The env variable CIBW_BUILD is set here to be able to format matrix.python-version correctly | |
- name: Set CIBW_BUILD environment variable using Python | |
env: | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
run: python ./.github/scripts/set_cibw_build_env.py | |
- name: Set up cibuildwheel Environment | |
shell: bash | |
run: | | |
if [[ "$RUNNER_OS" == "Linux" ]]; then | |
echo "CIBW_BEFORE_ALL_LINUX=yum install -y eigen3-devel && export EIGEN3_INCLUDE_DIR=/usr/include/eigen3" >> $GITHUB_ENV | |
echo "CIBW_ENVIRONMENT_LINUX=EIGEN3_INCLUDE_DIR=/usr/include/eigen3" >> $GITHUB_ENV | |
elif [[ "$RUNNER_OS" == "macOS" ]]; then | |
brew update | |
brew install eigen | |
EIGEN_DIR=$(brew --prefix eigen)/include/eigen3 | |
echo "EIGEN3_INCLUDE_DIR=$EIGEN_DIR" >> $GITHUB_ENV | |
elif [[ "$RUNNER_OS" == "Windows" ]]; then | |
choco install -y 7zip | |
curl -L -o eigen.zip https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.zip | |
"C:\Program Files\7-Zip\7z.exe" x eigen.zip -oeigen | |
EIGEN_DIR=$(cygpath -m "$PWD")/eigen/eigen-3.4.0 | |
echo "EIGEN3_INCLUDE_DIR=$EIGEN_DIR" >> $GITHUB_ENV | |
fi | |
- name: Build Wheels | |
run: | | |
cibuildwheel --output-dir dist/ | |
env: | |
CIBW_SKIP: "*_i686 *musllinux* pp* *win32" | |
- name: Upload Wheels as Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-${{ matrix.os }}-py${{ matrix.python-version }} | |
path: | | |
dist/*.whl | |
dist/*.tar.gz | |
dist/*.zip | |
retention-days: 7 | |
publish: | |
runs-on: ubuntu-latest | |
needs: build_wheels | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
path: artifacts # Downloads all artifacts into 'artifacts/' directory | |
- name: Move artifacts to dist directory | |
run: | | |
mkdir -p dist | |
find artifacts -type f -name "*.whl" -exec mv {} dist/ \; | |
find artifacts -type f -name "*.tar.gz" -exec mv {} dist/ \; | |
find artifacts -type f -name "*.zip" -exec mv {} dist/ \; | |
- name: Publish distribution | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |