Skip to content

Build OCP stubs

Build OCP stubs #3

name: Build OCP stubs
on: workflow_dispatch
env:
OCP: 7.8.1.1
jobs:
stubs:
name: Build OCP stubs for ${{ matrix.os }} on ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04"]
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} via micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-name: build-stubs
create-args: >-
python=${{ matrix.python-version }}
log-level: debug
init-shell: bash
cache-downloads: true
- name: Download official OCP source [PYWRAP=false]
shell: bash -l {0}
run: |
set -euo pipefail
curl -L -O https://github.com/CadQuery/OCP/releases/download/${{ env.OCP }}/OCP_src_stubs_ubuntu-20.04.zip
unzip OCP_src_stubs_*
rm *.zip
mv OCP_src_stubs_*/OCP-stubs pypi-stubs/
rm -rf OCP_src_stubs_*
- name: Create OCP stubs wheel
shell: bash -l {0}
run: |
set -euo pipefail
micromamba activate build-stubs
pip install build setuptools wheel
cd pypi-stubs
python -m build -w -n
- name: Upload cadquery_ocp stubs wheel
uses: actions/upload-artifact@v4
with:
name: cadquery-ocp-${{ env.OCP }}-stubs-cp${{ matrix.python-version }}
path: pypi-stubs/dist/*.whl