OSMesa #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: OSMesa | |
on: | |
workflow_dispatch: | |
#push | |
# Runs when a (published) GitHub Release is created | |
release: | |
types: | |
- published | |
jobs: | |
build_wheels: | |
name: Build lavavu-osmesa wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
env: | |
CIBW_BUILD_VERBOSITY: 3 | |
CIBW_SKIP: cp*-win32 *-manylinux_i686 *-musllinux_* | |
CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* | |
CIBW_ENVIRONMENT: LV_PACKAGE=lavavu-osmesa LV_OSMESA=1 LV_LIB_DIRS=/usr/local/lib | |
CIBW_BEFORE_BUILD_LINUX: echo "deb http://ftp.debian.org/debian stretch-backports main" | tee /etc/apt/sources.list.d/stretch-backports.list && apt-get update && apt install -y -t stretch-backports patchelf unzip meson libdrm-dev python3 python3-mako flex bison libwayland-dev libxrandr-dev llvm-dev wayland-protocols xz-utils gettext libtiff-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev && curl -kLO https://archive.mesa3d.org/mesa-19.2.8.tar.xz && tar xf mesa-19.2.8.tar.xz && rm -f mesa-19.2.8.tar.xz && cd mesa-19.2.8/ && meson build/ --buildtype=release -Dosmesa=gallium -Dgallium-drivers=swrast -Ddri-drivers= -Dvulkan-drivers= -Degl=false -Dgbm=false -Dgles1=false -Dgles2=false && ninja -C build/ -j5 && ninja -C build/ install || true | |
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_24 | |
CIBW_REPAIR_WHEEL_COMMAND: "auditwheel repair -w {dest_dir} {wheel} && python patchwheel.py {dest_dir}" | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Install cibuildwheel | |
run: | | |
python -m pip install cibuildwheel==2.16.2 | |
- name: Build wheels | |
run: | | |
python -m cibuildwheel --output-dir wheelhouse | |
- uses: actions/upload-artifact@v2 | |
with: | |
path: ./wheelhouse/*.whl | |
upload_pypi: | |
needs: [build_wheels] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@master | |
with: | |
user: ${{ secrets.pypi_username }} | |
password: ${{ secrets.pypi_password }} | |
# To test: repository_url: https://test.pypi.org/legacy/ | |
deploy_docker: | |
needs: [upload_pypi] #Requires lavavu-osmesa package to be uploaded | |
name: Build and push Docker image to GitHub Packages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: Add SHORT_SHA env property with commit short sha | |
run: echo "SHORT_SHA=`git rev-parse --short HEAD`" >> $GITHUB_ENV | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
ghcr.io/lavavu/lavavu | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=sha | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push to GitHub Packages | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
tags: | | |
ghcr.io/lavavu/lavavu:latest | |
${{ steps.meta.outputs.tags }} | |