Build wheel on Windows 2019 #137
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: Wheels | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build_source: | |
name: Build source package | |
runs-on: [ ubuntu-latest ] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
name: Install Python | |
with: | |
python-version: '3.x' | |
- name: Build source package (.tar.gz) | |
run: | | |
python -m pip install setuptools | |
python setup.py sdist | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: source | |
path: ./dist/*.tar.gz | |
build_python3_wheels: | |
name: Build Python 3 wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, windows-2019, macos-12] | |
if: github.actor == 'Legrandin' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Select architecture for MacOS | |
run: | | |
echo 'CIBW_ARCHS=x86_64 universal2' >> $GITHUB_ENV | |
if: runner.os == 'macOS' | |
- uses: pypa/[email protected] | |
name: Build wheels | |
env: | |
# cibuildwheel will build wheel once and test it for each CPython version | |
# and for PyPy > 3.8. | |
CIBW_BUILD: "cp36-* cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* pp39-* pp310-*" | |
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014" | |
CIBW_MANYLINUX_I686_IMAGE: "manylinux2014" | |
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: "manylinux2014" | |
CIBW_MANYLINUX_PYPY_I686_IMAGE: "manylinux2014" | |
CIBW_FREE_THREADED_SUPPORT: "true" | |
CIBW_BEFORE_TEST_LINUX: "(ldd /bin/ls | grep -q musl && apk add gmp) || true" | |
# Set pycryptodome/x test command according to built package | |
CIBW_TEST_COMMAND: | |
"${{ endsWith(github.ref, 'x') == true && | |
'python -m Cryptodome.SelfTest --skip-slow-tests' || | |
'python -m Crypto.SelfTest --skip-slow-tests' }}" | |
- name: Delete manylinux1 wheels | |
if: runner.os == 'Linux' | |
run: | | |
rm -f wheelhouse/*-manylinux1_i686.whl | |
rm -f wheelhouse/*-manylinux1_x86_64.whl | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: ./wheelhouse/*.whl | |
build_legacy_wheels: | |
name: Build legacy Python wheels on ${{ matrix.os }} (${{ matrix.arch }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-20.04, windows-2019, macos-12 ] | |
arch: [ multi-arch ] | |
# Python 2 on Windows requires manual toolchain setup (per-arch) due to newer MSVC used here | |
exclude: | |
- os: windows-2019 | |
arch: multi-arch | |
include: | |
- os: windows-latest | |
arch: x86 | |
- os: windows-latest | |
arch: x64 | |
if: github.actor == 'Legrandin' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install MSVC | |
if: runner.os == 'Windows' | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
toolset: 14.0 | |
arch: ${{ matrix.arch }} | |
- name: Set Windows build environment variables | |
if: runner.os == 'Windows' | |
run: | | |
echo "DISTUTILS_USE_SDK=1" >> $env:GITHUB_ENV | |
echo "MSSdk=1" >> $env:GITHUB_ENV | |
if ( '${{ matrix.arch }}' -eq 'x86' ) | |
{ | |
echo "CIBW_ARCHS=x86" >> $env:GITHUB_ENV | |
} | |
else | |
{ | |
echo "CIBW_ARCHS=AMD64" >> $env:GITHUB_ENV | |
} | |
- uses: pypa/[email protected] | |
name: Build wheels | |
env: | |
CIBW_BUILD: "cp27-* pp27-*" | |
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2010" | |
CIBW_MANYLINUX_I686_IMAGE: "manylinux2010" | |
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: "manylinux2010" | |
CIBW_MANYLINUX_PYPY_I686_IMAGE: "manylinux2010" | |
# Set pycryptodome/x test command according to built package | |
CIBW_TEST_COMMAND: | |
"${{ endsWith(github.ref, 'x') == true && | |
'python -m Cryptodome.SelfTest --skip-slow-tests' || | |
'python -m Crypto.SelfTest --skip-slow-tests' }}" | |
- name: Delete manylinux1 wheels | |
if: runner.os == 'Linux' | |
run: | | |
rm -f wheelhouse/*-manylinux1_i686.whl | |
rm -f wheelhouse/*-manylinux1_x86_64.whl | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: ./wheelhouse/*.whl |