diff --git a/.github/workflows/nmodl-wheel.yml b/.github/workflows/nmodl-wheel.yml new file mode 100644 index 0000000000..0876772222 --- /dev/null +++ b/.github/workflows/nmodl-wheel.yml @@ -0,0 +1,57 @@ +name: Build custom wheels + +concurrency: + group: ${{ github.workflow }}#${{ github.ref }} + cancel-in-progress: true + +on: + workflow_dispatch: + pull_request: + branches: + - master + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + timeout-minutes: 45 + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macOS-13] + + steps: + - name: Setup Flex and Bison + # reserved for future use + if: runner.os == 'Windows' + run: | + choco install winflexbison3 -y + + - name: Setup Flex and Bison + if: runner.os == 'macOS' + run: | + brew install flex bison + + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch: 0 + + # Used to host cibuildwheel + - name: Set up Python + uses: actions/setup-python@v3 + + - name: Install cibuildwheel + run: python -m pip install cibuildwheel==2.16.5 + + - name: Build all wheels + run: | + export SETUPTOOLS_SCM_PRETEND_VERSION="$(git describe --tags | cut -d '-' -f 1,2 | tr - .)" + python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_ARCHS: 'universal2' + + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }} + path: ./wheelhouse/*.whl