Pyomo Release Distribution Creation #91
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: Pyomo Release Distribution Creation | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
workflow_dispatch: | ||
inputs: | ||
git-ref: | ||
description: Git Hash (Optional) | ||
required: false | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
env: | ||
WITH_CYTHON: "--with-cython --with-distributable-extensions" | ||
WITHOUT_CYTHON: "--without-cython --with-distributable-extensions" | ||
jobs: | ||
native_wheels: | ||
name: Build wheels (${{ matrix.wheel-version }}) on ${{ matrix.os }} for native and cross-compiled architecture | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ubuntu-22.04, windows-latest, macos-13] | ||
arch: [all] | ||
wheel-version: ['cp38*', 'cp39*', 'cp310*', 'cp311*', 'cp312*'] | ||
include: | ||
- wheel-version: 'cp38*' | ||
TARGET: 'py38' | ||
GLOBAL_OPTIONS: ${{ env.WITH_CYTHON }} | ||
Check failure on line 36 in .github/workflows/release_wheel_creation.yml GitHub Actions / Pyomo Release Distribution CreationInvalid workflow file
|
||
- wheel-version: 'cp39*' | ||
TARGET: 'py39' | ||
GLOBAL_OPTIONS: ${{ env.WITH_CYTHON }} | ||
- wheel-version: 'cp310*' | ||
TARGET: 'py310' | ||
GLOBAL_OPTIONS: ${{ env.WITH_CYTHON }} | ||
- wheel-version: 'cp311*' | ||
TARGET: 'py311' | ||
GLOBAL_OPTIONS: ${{ env.WITHOUT_CYTHON }} | ||
- wheel-version: 'cp312*' | ||
TARGET: 'py312' | ||
GLOBAL_OPTIONS: ${{ env.WITHOUT_CYTHON }} | ||
exclude: | ||
- wheel-version: 'cp311*' | ||
os: windows-latest | ||
- wheel-version: 'cp312*' | ||
os: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
with: | ||
output-dir: dist | ||
env: | ||
CIBW_ARCHS_LINUX: "native" | ||
CIBW_ARCHS_MACOS: "native arm64" | ||
CIBW_ARCHS_WINDOWS: "native ARM64" | ||
CIBW_BUILD: ${{ matrix.wheel-version }} | ||
CIBW_SKIP: "*-musllinux*" | ||
CIBW_BUILD_VERBOSITY: 1 | ||
CIBW_BEFORE_BUILD: pip install cython pybind11 | ||
CIBW_ENVIRONMENT: PYOMO_SETUP_ARGS="${{ matrix.GLOBAL_OPTIONS }}" | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: native_wheels-${{ matrix.os }}-${{ matrix.TARGET }} | ||
path: dist/*.whl | ||
overwrite: true | ||
alternative_wheels: | ||
name: Build wheels (${{ matrix.wheel-version }}) on ${{ matrix.os }} for aarch64 | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-22.04] | ||
arch: [all] | ||
wheel-version: ['cp38*', 'cp39*', 'cp310*', 'cp311*', 'cp312*'] | ||
include: | ||
- wheel-version: 'cp38*' | ||
TARGET: 'py38' | ||
GLOBAL_OPTIONS: ${{ env.WITH_CYTHON }} | ||
- wheel-version: 'cp39*' | ||
TARGET: 'py39' | ||
GLOBAL_OPTIONS: ${{ env.WITH_CYTHON }} | ||
- wheel-version: 'cp310*' | ||
TARGET: 'py310' | ||
GLOBAL_OPTIONS: ${{ env.WITH_CYTHON }} | ||
- wheel-version: 'cp311*' | ||
TARGET: 'py311' | ||
GLOBAL_OPTIONS: ${{ env.WITHOUT_CYTHON }} | ||
- wheel-version: 'cp312*' | ||
TARGET: 'py312' | ||
GLOBAL_OPTIONS: ${{ env.WITHOUT_CYTHON }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up QEMU | ||
if: runner.os == 'Linux' | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: all | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
with: | ||
output-dir: dist | ||
env: | ||
CIBW_ARCHS_LINUX: "aarch64" | ||
CIBW_BUILD: ${{ matrix.wheel-version }} | ||
CIBW_SKIP: "*-musllinux*" | ||
CIBW_BUILD_VERBOSITY: 1 | ||
CIBW_BEFORE_BUILD: pip install cython pybind11 | ||
CIBW_ENVIRONMENT: PYOMO_SETUP_ARGS="${{ matrix.GLOBAL_OPTIONS }}" | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: alt_wheels-${{ matrix.os }}-${{ matrix.TARGET }} | ||
path: dist/*.whl | ||
overwrite: true | ||
pure_python: | ||
name: Build pure wheels (${{ matrix.python-version }}) | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.11'] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install twine wheel setuptools pybind11 | ||
- name: Build pure python wheel | ||
run: | | ||
python setup.py --without-cython sdist --format=gztar bdist_wheel | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: purepython_wheel-${{ matrix.python-version }} | ||
path: dist/*.whl | ||
overwrite: true | ||
generictarball: | ||
name: ${{ matrix.TARGET }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
include: | ||
- os: ubuntu-latest | ||
TARGET: generic_tarball | ||
python-version: [3.8] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install twine wheel setuptools pybind11 | ||
- name: Build generic tarball | ||
run: | | ||
python setup.py --without-cython sdist --format=gztar | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: generictarball | ||
path: dist | ||
overwrite: true | ||