Skip to content

Commit

Permalink
Add support for publishing macOS M1 ARM64 wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
lgeiger committed Sep 7, 2021
1 parent 19c468c commit 9634f7f
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 4 deletions.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions .github/workflows/make_wheel_macOS_arm64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
set -e -x

export TF_NEED_CUDA=0

python --version
python -m pip install --default-timeout=1000 delocate wheel setuptools tensorflow==$TF_VERSION

python configure.py

bazel build \
--cpu=darwin_arm64 \
--copt -mmacosx-version-min=11.0 \
--linkopt -mmacosx-version-min=11.0 \
--noshow_progress \
--noshow_loading_progress \
--verbose_failures \
--test_output=errors \
build_pip_pkg

bazel-bin/build_pip_pkg artifacts "--plat-name macosx_11_0_arm64 $NIGHTLY_FLAG"
delocate-wheel -w wheelhouse artifacts/*.whl

File renamed without changes.
21 changes: 17 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['macos-latest', 'windows-latest', 'ubuntu-18.04']
os: ['macos-11', 'windows-latest', 'ubuntu-18.04']
py-version: ['3.6', '3.7', '3.8', '3.9']
tf-version: ['2.4.2', '2.6.0']
cpu: ['x86', 'arm64']
exclude:
- os: 'ubuntu-18.04'
cpu: 'arm64'
- os: 'windows-latest'
cpu: 'arm64'
fail-fast: false
steps:
- uses: actions/[email protected]
Expand Down Expand Up @@ -68,12 +74,13 @@ jobs:
PY_VERSION: ${{ matrix.py-version }}
TF_VERSION: ${{ matrix.tf-version }}
NIGHTLY_TIME: ${{ steps.author-date.outputs.result }}
CPU: ${{ matrix.cpu }}
shell: bash
run: bash .github/workflows/make_wheel_${OS}.sh
run: bash .github/workflows/make_wheel_${OS}_${CPU}.sh
- if: matrix.py-version != '3.9' || matrix.tf-version != '2.4.2'
uses: actions/upload-artifact@v1
with:
name: ${{ runner.os }}-${{ matrix.py-version }}-tf${{ matrix.tf-version }}-wheel
name: ${{ runner.os }}-${{ matrix.py-version }}-tf${{ matrix.tf-version }}-${{ matrix.cpu }}-wheel
path: wheelhouse
upload-wheels:
name: Publish wheels to PyPi
Expand All @@ -84,12 +91,18 @@ jobs:
os: ['macOS', 'Windows', 'Linux']
py-version: ['3.6', '3.7', '3.8', '3.9']
tf-version: ['2.6.0']
cpu: ['x86', 'arm64']
exclude:
- os: 'Linux'
cpu: 'arm64'
- os: 'Windows'
cpu: 'arm64'
fail-fast: false
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release'
steps:
- uses: actions/download-artifact@v1
with:
name: ${{ matrix.os }}-${{ matrix.py-version }}-tf${{ matrix.tf-version }}-wheel
name: ${{ matrix.os }}-${{ matrix.py-version }}-tf${{ matrix.tf-version }}-${{ matrix.cpu }}-wheel
path: ./dist
- run: |
set -e -x
Expand Down

0 comments on commit 9634f7f

Please sign in to comment.