-
Notifications
You must be signed in to change notification settings - Fork 0
169 lines (139 loc) · 4.76 KB
/
build_static_libraries.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: Build Static Libraries
on:
push:
branches:
- main
jobs:
Build-aarch64-apple-debug:
runs-on: macos-latest
environment: prod-deploy
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up Python 3.12.5
uses: actions/setup-python@v5
with:
python-version: 3.12.5
- name: Setup for Macos
shell: bash
run: ./setup_aarch64_macos.sh
- name: Build Executroch library with Debug mode
shell: bash
run: ./build.sh --target=aarch64-apple-ios --mode=Debug --no-venv
- name: Copy the prebuilt library to the executorch-apple directory
run: |
mkdir -p out-apple/executorch-apple-debug
cp -r target/executorch-prebuilt/* out-apple/executorch-apple-debug
- name: Upload Built Library
uses: actions/upload-artifact@v4
with:
name: executorch-apple-debug
path: out-apple
Build-aarch64-apple-release:
runs-on: macos-latest
environment: prod-deploy
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Setup for Macos
shell: bash
run: ./setup_aarch64_macos.sh
- name: Build Executroch library with Release mode
shell: bash
run: ./build.sh --target=aarch64-apple-ios --mode=Release --no-venv
- name: Copy the prebuilt library to the executorch-apple directory
run: |
mkdir -p out-apple/executorch-apple-release
cp -r target/executorch-prebuilt/* out-apple/executorch-apple-release
- name: Upload Built Library
uses: actions/upload-artifact@v4
with:
name: executorch-apple-release
path: out-apple
Build-aarch64-android:
runs-on: ubuntu-latest
environment: prod-deploy
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Set up NDK
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r27c
add-to-path: false
- name: Setup for Linux
shell: bash
run: ./setup_amd64_linux.sh
- name: Build Executroch library with Debug mode
shell: bash
run: |
./build.sh --target=aarch64-linux-android --mode=Debug --no-venv
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
- name: Build Executroch library with Release mode
shell: bash
run: ./build.sh --target=aarch64-linux-android --mode=Release --no-venv
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
- name: Copy the prebuilt library to the executorch-android directory
run: |
mkdir -p out-android/executorch-android
cp -r target/executorch-prebuilt/* out-android/executorch-android
- name: Upload Built Library
uses: actions/upload-artifact@v4
with:
name: executorch-android
path: out-android
Upload-Release:
runs-on: ubuntu-latest
environment: prod-deploy
needs: [Build-aarch64-apple-debug, Build-aarch64-apple-release, Build-aarch64-android]
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download executorch-apple-debug
uses: actions/download-artifact@v4
with:
name: executorch-apple-debug
- name: Download executorch-apple-release
uses: actions/download-artifact@v4
with:
name: executorch-apple-release
- name: Download executorch-android
uses: actions/download-artifact@v4
with:
name: executorch-android
- name: Set the tag from TAG file to environment variable
run: |
export TAG=$(cat TAG)
echo "TAG: $TAG"
echo "TAG=${TAG}" >> $GITHUB_ENV
- name: Create a zip of both artifacts
run: |
mkdir executorch-prebuilt-${TAG}
touch executorch-prebuilt-${TAG}/.gitkeep
cp -r executorch-apple-debug/* executorch-prebuilt-${TAG}/
cp -r executorch-apple-release/* executorch-prebuilt-${TAG}/
cp -r executorch-android/* executorch-prebuilt-${TAG}/
zip -r release-${TAG}.zip executorch-prebuilt-${TAG}
- name: Upload release assets
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: release-${{ env.TAG }}.zip
tag_name: ${{ env.TAG }}