Skip to content

Release arm64 on macOS #18

Release arm64 on macOS

Release arm64 on macOS #18

Workflow file for this run

name: Release arm64 on macOS
on:
workflow_dispatch:
permissions:
contents: read
jobs:
macos-arm64-bazel:
name: Bazel arm64 on macOS
runs-on: macos-13-xlarge
steps:
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
with:
fetch-depth: 0
- name: Bazel on macOS
run: |
set -x -e
bash -e .github/workflows/build.bazel.sh python3
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: ${{ runner.os }}-arm64-bazel-bin
path: |
build/tensorflow_io
build/tensorflow_io_gcs_filesystem
- run: |
set -x -e
echo "Successfully completely macOS arm64 release"
macos-arm64-wheel:
name: Wheel ${{ matrix.python }} macOS arm64
needs: macos-arm64-bazel
runs-on: macos-13-xlarge
strategy:
matrix:
python: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
- uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6
with:
name: ${{ runner.os }}-arm64-bazel-bin
path: bazel-bin
#- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
# with:
# python-version: "${{ matrix.python }}"
- name: Wheel ${{ matrix.python }} macOS
run: |
set -x -e
python3 --version
python --version
brew search python
brew install python@${{ matrix.python }}
python${{ matrix.python }} --version
python${{ matrix.python }} -m pip install --break-system-packages -U wheel setuptools
python${{ matrix.python }} setup.py --data bazel-bin -q bdist_wheel --plat-name macosx_12_0_arm64
rm -rf build
python${{ matrix.python }} setup.py --project tensorflow-io-gcs-filesystem --data bazel-bin -q bdist_wheel --plat-name macosx_12_0_arm64
ls dist/*
mkdir -p wheelhouse
for f in dist/*.whl; do
echo "disable delocate due to build breaks: delocate-wheel -w wheelhouse $f"
cp $f wheelhouse
done
ls wheelhouse/*
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: ${{ runner.os }}-arm64-${{ matrix.python }}-wheel
path: wheelhouse
release-macos-arm64:
name: Release (MacOS arm64)
needs: macos-arm64-wheel
runs-on: ubuntu-20.04
steps:
- uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6
with:
name: macOS-arm64-3.9-wheel
path: macOS-arm64-3.9-wheel
- uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6
with:
name: macOS-arm64-3.10-wheel
path: macOS-arm64-3.10-wheel
- uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6
with:
name: macOS-arm64-3.11-wheel
path: macOS-arm64-3.11-wheel
- uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6
with:
name: macOS-arm64-3.12-wheel
path: macOS-arm64-3.12-wheel
- run: |
set -e -x
mkdir -p wheelhouse
cp macOS-arm64-3.9-wheel/*.whl wheelhouse/
cp macOS-arm64-3.10-wheel/*.whl wheelhouse/
cp macOS-arm64-3.11-wheel/*.whl wheelhouse/
cp macOS-arm64-3.12-wheel/*.whl wheelhouse/
ls -la wheelhouse/
sha256sum wheelhouse/*.whl
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: tensorflow-io-release-macos-arm64
path: wheelhouse
release-candidate-macos-arm64:
name: Release Candidate (MacOS arm64)
needs: release-macos-arm64
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
- uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6
with:
name: tensorflow-io-release-macos-arm64
path: wheelhouse
- run: |
set -x -e
sha256sum wheelhouse/*.whl | sort -u > wheelhouse.sha256
git rev-parse --verify HEAD > wheelhouse.commit
grep 'version = ' tensorflow_io/python/ops/version_ops.py | sed -E 's@^.*version = "@@g' | sed -E 's@".*$@@g' > wheelhouse.version
cat wheelhouse.sha256
cat wheelhouse.commit
cat wheelhouse.version
echo "::set-output name=version::$(cat wheelhouse.version)"
id: info
- run: |-
cat <<EOF > Dockerfile
FROM gcr.io/distroless/base-debian11
COPY wheelhouse /wheelhouse
COPY wheelhouse.sha256 /wheelhouse.sha256
COPY wheelhouse.commit /wheelhouse.commit
COPY wheelhouse.version /wheelhouse.version
EOF
- uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
- uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
with:
username: tfsigio
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: .
push: true
tags: tfsigio/candidate:macos-arm64-${{ steps.info.outputs.version }}