Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stakemura committed Nov 8, 2023
0 parents commit 6ef01c0
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build TensorFlow Lite runtime

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
build-macos:
runs-on: macos-latest
env:
in_path: "bin/tensorflow/lite/c/libtensorflowlite_c.dylib"
out_path: "libtensorflowlite_c.dylib"
steps:
- uses: actions/checkout@v3
with:
repository: tensorflow/tensorflow
ref: ${{ github.ref_name }}
submodules: true
github-server-url: https://github.com

- uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies
run: npm install -g @bazel/bazelisk

- name: Build
run: |
bazel build --config=macos --cpu=darwin -c opt --define tflite_with_xnnpack=true tensorflow/lite/c:tensorflowlite_c
bazel build --config=macos_arm64 --cpu=darwin_arm64 -c opt --define tflite_with_xnnpack=true tensorflow/lite/c:tensorflowlite_c
lipo -create -output ${{ env.out_path }} bazel-out/darwin-opt/${{ env.in_path }} bazel-out/darwin_arm64-opt/${{ env.in_path }}
- name: Archive
uses: actions/upload-artifact@v3
with:
name: tensorflowlite_c-macos-universal
path: ${{ env.out_path }}

- name: Release
uses: softprops/action-gh-release@v1
with:
files: ${{ env.out_path }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# tflite-runtime-builder
Build TensorFlow Lite runtime with GitHub Actions

0 comments on commit 6ef01c0

Please sign in to comment.