Skip to content

Commit

Permalink
Build MacOS universal wheels (#160)
Browse files Browse the repository at this point in the history
* Build MacOS universal wheels

* reorder has secrets

* ARM64 to cibuildwheel 1.9

* Reorder and clean

* Unify
  • Loading branch information
hoffmang9 authored Feb 6, 2021
1 parent 372076c commit e2cc332
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 40 deletions.
28 changes: 12 additions & 16 deletions .github/workflows/build-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -41,8 +28,7 @@ jobs:
python3 -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
pip install wheel
python -m pip install cibuildwheel==1.8.0
python -m pip install cibuildwheel==1.9.0
- name: Lint source with flake8
run: |
Expand All @@ -56,7 +42,7 @@ jobs:
pip install mypy
mypy --config-file mypi.ini python-bindings python-impl
- name: Build wheel and test
- name: Build wheels and test
run: |
source venv/bin/activate
python -m cibuildwheel --output-dir dist
Expand Down Expand Up @@ -88,6 +74,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
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +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

- uses: actions/setup-python@v2
name: Install Python
Expand Down
39 changes: 18 additions & 21 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,15 @@ 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 src setup.py python-bindings python-impl
Expand All @@ -60,9 +43,10 @@ jobs:
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/[email protected]
with:
output-dir: dist
env:
CIBW_BUILD_VERBOSITY_MACOS: 0
CIBW_BUILD_VERBOSITY_LINUX: 0
Expand Down Expand Up @@ -96,6 +80,9 @@ jobs:
python -m pip install --upgrade pip
CIBW_ENVIRONMENT_MACOS: "MACOSX_DEPLOYMENT_TARGET=10.14"
# GH hosted MacOS runner has gmp and libsodium natively
# CIBW_ARCHS_MACOS: x86_64 arm64 universal2
CIBW_ARCHS_MACOS: x86_64 universal2
CIBW_TEST_SKIP: '*_arm64 *_universal2:arm64'
CIBW_BEFORE_BUILD_MACOS: >
python -m pip install --upgrade pip
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
Expand Down Expand Up @@ -133,6 +120,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

Expand Down

0 comments on commit e2cc332

Please sign in to comment.