1
1
name : Build-aarch64_Linux-Generic-Jammy
2
+
2
3
on :
3
4
workflow_dispatch :
4
- pull_request :
5
+ push :
5
6
branches :
6
7
- main
8
+ pull_request :
9
+ branches :
10
+ - main
7
11
release :
8
12
types : [created]
9
13
10
14
permissions :
11
15
contents : write
12
16
17
+ env :
18
+ GH_TOKEN : ${{ secrets.GH_PAT }}
19
+ OWNER : collaborativeroboticslab
20
+ TENSORFLOW_TAG : v2.13.0
21
+
13
22
jobs :
14
23
deploy :
15
24
runs-on : ubuntu-22.04
16
- env :
17
- GH_TOKEN : ${{ secrets.GH_PAT }}
18
- OWNER : collaborativeroboticslab
25
+
19
26
steps :
20
27
- uses : actions/checkout@v4.1.1
28
+
21
29
- run : sudo apt-get remove gcc g++
22
30
23
31
- name : Install prerequisite packages (Bazel & zip)
@@ -28,27 +36,25 @@ jobs:
28
36
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/bazel-archive-keyring.gpg] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
29
37
sudo apt update
30
38
sudo apt-get -y install zip bazel-6.5.0
31
-
39
+
32
40
- name : Clone the TensorFlow repository
33
41
run : git clone https://github.com/tensorflow/tensorflow
34
42
35
- - name : Checkout latest version tag
43
+ - name : Checkout specified TensorFlow version
36
44
id : tf_tag
37
45
working-directory : tensorflow
38
46
run : |
39
47
git fetch --tags
40
- latest_tag=$(git tag --sort=-creatordate | grep "^v" | head -n 1)
41
- echo "Using latest tag: $latest_tag"
42
- echo "latest_tag=$latest_tag" >> $GITHUB_OUTPUT
43
- git checkout "$latest_tag"
48
+ git checkout "$TENSORFLOW_TAG"
49
+ echo "latest_tag=$TENSORFLOW_TAG" >> $GITHUB_OUTPUT
44
50
45
- - name : Build the tensorflow lite library using Bazel
51
+ - name : Build the TensorFlow Lite library using Bazel
46
52
working-directory : ./tensorflow
47
53
run : >
48
54
bazel build --config=elinux_aarch64 //tensorflow/lite:libtensorflowlite.so
49
55
--cxxopt=-DXNNPACK_ENABLE_ARM_BF16=OFF
50
56
--cxxopt=-DXNNPACK_ENABLE_ARM_I8MM=OFF
51
-
57
+
52
58
- name : Assemble package
53
59
working-directory : ./tensorflow
54
60
run : mkdir -p ../package/lib ../package/include/tensorflow/lite
@@ -57,11 +63,11 @@ jobs:
57
63
working-directory : ./tensorflow
58
64
run : cp -r bazel-tensorflow/external/flatbuffers/include/* ../package/include
59
65
60
- - name : Copy include files from tensorflow lite into new package
66
+ - name : Copy include files from TensorFlow Lite into new package
61
67
working-directory : ./tensorflow
62
68
run : cp -r tensorflow/lite/* ../package/include/tensorflow/lite
63
69
64
- - name : Copy dynamic library file (.so) from bazel build dir to new package
70
+ - name : Copy dynamic library file (.so) from Bazel build dir to new package
65
71
working-directory : ./tensorflow
66
72
run : cp bazel-bin/tensorflow/lite/libtensorflowlite.so ../package/lib/
67
73
71
77
- name : Remove other language bindings/examples/docs from the include directory
72
78
run : rm -r package/include/tensorflow/lite/{testing,java,ios,objc,python,tools,swift,examples}
73
79
74
- - name : Strip the tensorflow lite include dir (so that it only contains header files )
80
+ - name : Strip the TensorFlow Lite include dir (only keep headers )
75
81
run : find package/include/tensorflow -type f ! -name "*.h" ! -name "*.hpp" -delete
76
82
77
83
- name : Remove empty folders
@@ -82,22 +88,22 @@ jobs:
82
88
83
89
- name : Create GitHub release if it doesn't exist
84
90
run : |
85
- gh release view "${{ steps.tf_tag.outputs.latest_tag }} " --repo $OWNER/TensorFlow_Lite_Compiled || \
86
- gh release create "${{ steps.tf_tag.outputs.latest_tag }} " \
91
+ gh release view "$TENSORFLOW_TAG " --repo $OWNER/TensorFlow_Lite_Compiled || \
92
+ gh release create "$TENSORFLOW_TAG " \
87
93
--repo $OWNER/TensorFlow_Lite_Compiled \
88
- --title "${{ steps.tf_tag.outputs.latest_tag }} " \
89
- --notes "Auto-generated release for TensorFlow Lite ${{ steps.tf_tag.outputs.latest_tag }} "
94
+ --title "$TENSORFLOW_TAG " \
95
+ --notes "Auto-generated release for TensorFlow Lite $TENSORFLOW_TAG "
90
96
env :
91
97
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
92
98
93
99
- name : Remove existing release asset (if exists)
94
100
run : |
95
- gh release delete-asset "${{ steps.tf_tag.outputs.latest_tag }} " tensorflow_linux_generic_aarch64_jammy.zip --repo $OWNER/TensorFlow_Lite_Compiled || true
101
+ gh release delete-asset "$TENSORFLOW_TAG " tensorflow_linux_generic_aarch64_jammy.zip --repo $OWNER/TensorFlow_Lite_Compiled || true
96
102
env :
97
103
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
98
-
104
+
99
105
- name : Upload Release Asset
100
106
env :
101
107
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
102
- run :
103
- gh release upload "${{ steps.tf_tag.outputs.latest_tag }} " tensorflow_linux_generic_aarch64_jammy.zip --repo $OWNER/TensorFlow_Lite_Compiled
108
+ run : |
109
+ gh release upload "$TENSORFLOW_TAG " tensorflow_linux_generic_aarch64_jammy.zip --repo $OWNER/TensorFlow_Lite_Compiled
0 commit comments