fix: runs on macos-14-arm64 #75
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: macos-precompile | |
on: | |
push: | |
tags: | |
- 'v*' | |
- 'precompile-test' | |
- 'precompile-test-macos' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
precompile: | |
runs-on: ${{ matrix.pair.runs_on }} | |
env: | |
TFLITE_BEAM_PREFER_PRECOMPILED: "false" | |
OTP_VERSION: ${{ matrix.pair.otp }} | |
ELIXIR_VERSION: "1.16.3" | |
name: ${{ matrix.pair.arch }}-apple-darwin - OTP ${{ matrix.pair.otp }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# remember to change the `get_precompiled_nif_version/0` function in the `tflite_beam_precompiled` file | |
# if upgrade the Erlang/OTP version to 26.x or later _kai_run_matmul_clamp_f32_qai8dxp1x8_qsi4cxp8x8_1x8x32_neon_dotprod | |
# 2.16 for OTP 24.x and 25.x | |
# 2.17 for OTP 26.x | |
- pair: | |
otp: "25.3.2.9" | |
arch: x86_64 | |
libedgetpu_library: darwin_x86_64 | |
runs_on: macos-13 | |
- pair: | |
otp: "25.3.2.9" | |
arch: aarch64 | |
libedgetpu_library: darwin_arm64 | |
runs_on: macos-14-arm64 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install OTP and rebar3 | |
run: | | |
curl -fsSO https://elixir-lang.org/install.sh | |
sh install.sh "elixir@${ELIXIR_VERSION}" "otp@${OTP_VERSION}" | |
export PATH=$HOME/.elixir-install/installs/otp/${OTP_VERSION}/bin:$PATH | |
wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3 | |
./rebar3 local install | |
- name: Setup cmake | |
uses: jwlawson/actions-setup-cmake@v2 | |
with: | |
cmake-version: '3.22.x' | |
- name: Create precompiled library | |
run: | | |
export PATH=$HOME/.elixir-install/installs/otp/${OTP_VERSION}/bin:$PATH | |
export PATH=$HOME/.cache/rebar3/bin:$PATH | |
export NIF_VERSION="$(erl -noshell -eval "io:format('~ts', [erlang:system_info(nif_version)])." -s erlang halt)" | |
rebar3 deps | |
rebar3 compile | |
export PKG_NAME=tflite_beam-nif-${NIF_VERSION}-${{ matrix.pair.arch }}-apple-darwin-${GITHUB_REF##*/} | |
mkdir -p "${PKG_NAME}" | |
cp -a ./priv "${PKG_NAME}" | |
tar -czf "${PKG_NAME}.tar.gz" "${PKG_NAME}" | |
rm -rf "${PKG_NAME}" | |
mkdir -p artifacts | |
mv "${PKG_NAME}.tar.gz" artifacts | |
- uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: artifacts/tflite_beam-*.tar.gz |