From c6a11e673c997d649292637d433f78cbda7ddbd2 Mon Sep 17 00:00:00 2001 From: Gene Hoffman Date: Fri, 5 Feb 2021 21:13:24 -0800 Subject: [PATCH] Build MacOS Universal wheels --- .github/workflows/build-aarch64.yml | 25 ++++++++-------- .github/workflows/build.yml | 44 ++++++++++++----------------- 2 files changed, 29 insertions(+), 40 deletions(-) diff --git a/.github/workflows/build-aarch64.yml b/.github/workflows/build-aarch64.yml index e8ade80..c4e8cb5 100644 --- a/.github/workflows/build-aarch64.yml +++ b/.github/workflows/build-aarch64.yml @@ -20,19 +20,6 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - with: - fetch-depth: 0 - # we need fetch-depth 0 so setuptools_scm can resolve tags - - - name: Test for secrets access - id: check_secrets - shell: bash - run: | - unset HAS_SECRET - if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi - echo ::set-output name=HAS_SECRET::${HAS_SECRET} - env: - SECRET: "${{ secrets.test_pypi_password }}" - name: Prepare cibuildwheel run: | @@ -42,7 +29,7 @@ jobs: source venv/bin/activate python -m pip install --upgrade pip pip install wheel - pip install cibuildwheel==1.8.0 + pip install cibuildwheel==1.9.0 - name: Lint source with flake8 run: | @@ -79,6 +66,16 @@ jobs: name: wheels path: ./dist + - name: Test for secrets access + id: check_secrets + shell: bash + run: | + unset HAS_SECRET + if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi + echo ::set-output name=HAS_SECRET::${HAS_SECRET} + env: + SECRET: "${{ secrets.test_pypi_password }}" + - name: Install twine run: | source venv/bin/activate diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8d2736f..250d51c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,49 +20,28 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - with: - fetch-depth: 0 - # we need fetch-depth 0 so setuptools_scm can resolve tags - uses: actions/setup-python@v2 name: Install Python with: python-version: '3.8' - - name: Test for secrets access - id: check_secrets - shell: bash - run: | - unset HAS_SECRET - if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi - echo ::set-output name=HAS_SECRET::${HAS_SECRET} - env: - SECRET: "${{ secrets.test_pypi_password }}" - - - name: Install cibuildwheel - run: | - python -m pip install --upgrade pip - python -m pip install cibuildwheel==1.8.0 - - name: Lint source with flake8 run: | + python -m pip install --upgrade pip pip install flake8 flake8 tests setup.py -# - name: Lint source with mypy -# run: | -# pip install mypy -# mypy --config-file mypi.ini setup.py tests - - name: Build source distribution with Ubuntu if: startsWith(matrix.os, 'ubuntu') run: | pip install build python -m build --sdist --outdir dist . - - name: Build wheel and test - run: | - python -m cibuildwheel --output-dir dist + - name: Build ${{ matrix.os }} wheels and test + uses: joerick/cibuildwheel@v1.9.0 + with: + output-dir: dist env: # build just python 3.7 CIBW_BUILD: cp37-* cp38-* cp39-* @@ -74,6 +53,9 @@ jobs: CIBW_BEFORE_BUILD_LINUX: > python -m pip install --upgrade pip && pip install pybind11 + # CIBW_ARCHS_MACOS: x86_64 arm64 universal2 + CIBW_ARCHS_MACOS: x86_64 universal2 + CIBW_TEST_SKIP: '*_arm64 *_universal2:arm64' CIBW_BEFORE_ALL_MACOS: > brew install boost CIBW_BEFORE_BUILD_MACOS: > @@ -93,6 +75,16 @@ jobs: name: wheels path: ./dist + - name: Test for secrets access + id: check_secrets + shell: bash + run: | + unset HAS_SECRET + if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi + echo ::set-output name=HAS_SECRET::${HAS_SECRET} + env: + SECRET: "${{ secrets.test_pypi_password }}" + - name: Install twine run: pip install twine