Skip to content

v0.10.38 Autodetection of treadmill trials #158

v0.10.38 Autodetection of treadmill trials

v0.10.38 Autodetection of treadmill trials #158

name: Build and Publish Wheels (Linux x86_64)
on:
workflow_dispatch:
release:
types: [published]
jobs:
build-linux-x86_64:
name: Linux Python x86_64 ${{ matrix.python-version }} - Build Wheels
runs-on: ubuntu-latest
container: keenon/diffdart:base
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: /opt/python/cp38-cp38/bin/python3.8
PYTHON_PATH: /opt/python/cp38-cp38/bin/
PYTHON_INCLUDE: /opt/python/cp38-cp38/include/python3.8/
PYTHON_LIB: /opt/python/cp38-cp38/lib/python3.8
- python-version: "3.9"
PYTHON_VERSION_CODE: cp39-cp39
PYTHON_VERSION_NUMBER: "3.9"
PYTHON: /opt/python/cp39-cp39/bin/python3.9
PYTHON_PATH: /opt/python/cp39-cp39/bin/
PYTHON_INCLUDE: /opt/python/cp39-cp39/include/python3.9/
PYTHON_LIB: /opt/python/cp39-cp39/lib/python3.9
- python-version: "3.10"
PYTHON_VERSION_CODE: cp310-cp310
PYTHON_VERSION_NUMBER: "3.10"
PYTHON: /opt/python/cp310-cp310/bin/python3.10
PYTHON_PATH: /opt/python/cp310-cp310/bin/
PYTHON_INCLUDE: /opt/python/cp310-cp310/include/python3.10/
PYTHON_LIB: /opt/python/cp310-cp310/lib/python3.10
- python-version: "3.11"
PYTHON_VERSION_CODE: cp311-cp311
PYTHON_VERSION_NUMBER: "3.11"
PYTHON: /opt/python/cp311-cp311/bin/python3.11
PYTHON_PATH: /opt/python/cp311-cp311/bin/
PYTHON_INCLUDE: /opt/python/cp311-cp311/include/python3.11/
PYTHON_LIB: /opt/python/cp311-cp311/lib/python3.11
steps:
- name: Check out the repo
uses: actions/checkout@v2
- 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: ${{ matrix.PYTHON }} -m pip install pytest wheel auditwheel==5.1.2 pybind11-stubgen==0.16.2 numpy torch
- name: Install Pybind11 for this Python version
run: |
git clone https://github.com/pybind/pybind11.git
pushd pybind11
git checkout v2.11.1
mkdir build
pushd build
PATH="${{ matrix.PYTHON_PATH }}:${PATH}" CPATH="${{ matrix.PYTHON_INCLUDE }}" cmake ..
PATH="${{ matrix.PYTHON_PATH }}:${PATH}" CPATH="${{ matrix.PYTHON_INCLUDE }}" make install -j2
env:
PYTHON: ${{ matrix.PYTHON }}
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION_CODE }}
PYTHON_INCLUDE: ${{ matrix.PYTHON_INCLUDE }}
PYTHON_LIB: ${{ matrix.PYTHON_LIB }}
PYTHON_VERSION_NUMBER: ${{ matrix.PYTHON_VERSION_NUMBER }}
- name: Build wheel
run: |
PATH="${{ matrix.PYTHON_PATH }}:${PATH}" CPATH="${{ matrix.PYTHON_INCLUDE }}" ${{ matrix.PYTHON }} setup.py sdist bdist_wheel
PATH="${{ matrix.PYTHON_PATH }}:${PATH}" CPATH="${{ matrix.PYTHON_INCLUDE }}" ${{ matrix.PYTHON }} -m auditwheel repair dist/nimblephysics-${{ env.VERSION }}-${{ matrix.PYTHON_VERSION_CODE }}-linux_x86_64.whl
env:
PYTHON: ${{ matrix.PYTHON }}
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION_CODE }}
PYTHON_INCLUDE: ${{ matrix.PYTHON_INCLUDE }}
PYTHON_LIB: ${{ matrix.PYTHON_LIB }}
PYTHON_VERSION_NUMBER: ${{ matrix.PYTHON_VERSION_NUMBER }}
- name: Publish artifact
uses: actions/upload-artifact@v2
with:
name: nimblephysics-${{ env.VERSION }}-${{ matrix.PYTHON_VERSION_CODE }}-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
path: wheelhouse/nimblephysics-${{ env.VERSION }}-${{ matrix.PYTHON_VERSION_CODE }}-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [build-linux-x86_64]
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
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