@@ -36,15 +36,18 @@ jobs:
36
36
run : |
37
37
make
38
38
39
+ - name : Zip executables
40
+ run : zip alpaca-linux.zip chat
41
+
39
42
- name : Archive production artifacts
40
43
uses : actions/upload-artifact@v3
41
44
with :
42
- name : ubuntu
45
+ name : linux
43
46
path : |
44
- chat
47
+ alpaca-linux.zip
45
48
46
49
47
- macOS -latest :
50
+ macos -latest :
48
51
runs-on : macOS-latest
49
52
50
53
steps :
@@ -60,39 +63,45 @@ jobs:
60
63
- name : Build
61
64
id : make_build
62
65
run : |
63
- make
66
+ make chat_mac
67
+
68
+ - name : Codesign executable
69
+ if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
70
+ env :
71
+ MACOS_CERTIFICATE : ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
72
+ MACOS_CERTIFICATE_PWD : ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
73
+ KEYCHAIN_PWD : ${{ secrets.KEYCHAIN_PASSWORD }}
74
+ MACOS_CERT_ID : ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_ID }}
75
+
76
+ run : |
77
+ echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
78
+ security create-keychain -p $KEYCHAIN_PWD build.keychain
79
+ security default-keychain -s build.keychain
80
+ security unlock-keychain -p $KEYCHAIN_PWD build.keychain
81
+ security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
82
+ security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $KEYCHAIN_PWD build.keychain
83
+ /usr/bin/codesign --options runtime --force -s $MACOS_CERT_ID ./chat_mac -v
84
+
85
+ - name : Zip executables
86
+ run : zip alpaca-mac.zip chat_mac
87
+
88
+ - name : Notarize executables
89
+ if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
90
+ env :
91
+ PROD_MACOS_NOTARIZATION_APPLE_ID : ${{ secrets.AC_USERNAME }}
92
+ PROD_MACOS_NOTARIZATION_PWD : ${{ secrets.AC_PASSWORD }}
93
+ PROD_MACOS_NOTARIZATION_TEAM_ID : ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
94
+ run : |
95
+ xcrun notarytool store-credentials "notarytool-profile" --apple-id "$PROD_MACOS_NOTARIZATION_APPLE_ID" --team-id "$PROD_MACOS_NOTARIZATION_TEAM_ID" --password "$PROD_MACOS_NOTARIZATION_PWD"
96
+ xcrun notarytool submit "alpaca-mac.zip" --keychain-profile "notarytool-profile" --wait
64
97
65
98
- name : Archive production artifacts
66
99
uses : actions/upload-artifact@v3
67
100
with :
68
101
name : macos
69
102
path : |
70
- chat
71
-
72
- # macos-arm64:
73
- # runs-on: macos-arm64
74
-
75
- # steps:
76
- # - name: Clone
77
- # id: checkout
78
- # uses: actions/checkout@v1
79
-
80
- # - name: Dependencies
81
- # id: depends
82
- # run: |
83
- # brew update
84
-
85
- # - name: Build
86
- # id: make_build
87
- # run: |
88
- # make
103
+ alpaca-mac.zip
89
104
90
- # - name: Archive production artifacts
91
- # uses: actions/upload-artifact@v3
92
- # with:
93
- # name: macos
94
- # path: |
95
- # chat
96
105
97
106
windows-latest :
98
107
runs-on : windows-latest
@@ -110,227 +119,70 @@ jobs:
110
119
cmake ..
111
120
cmake --build . --config Release
112
121
113
- - name : Set commit hash variables
114
- id : commit
115
- if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
116
- uses : pr-mpt/actions-commit-hash@v2
117
-
118
122
- name : Pack artifacts
119
123
id : pack_artifacts
120
- if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
121
124
run : |
122
- 7z a alpaca-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-x64.zip .\build\Release\*
125
+ 7z a alpaca-win.zip .\build\Release\*
126
+
127
+ - name : Archive production artifacts
128
+ uses : actions/upload-artifact@v3
129
+ with :
130
+ name : windows
131
+ path : |
132
+ alpaca-win.zip
133
+
134
+
135
+ release :
136
+ runs-on : ubuntu-latest
137
+ if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
138
+ needs :
139
+ - windows-latest
140
+ - macos-latest
141
+ - ubuntu-latest
142
+
143
+ steps :
144
+ - name : Download all workflow run artifacts
145
+ uses : actions/download-artifact@v3
146
+
147
+ - name : Set commit hash variables
148
+ id : commit
149
+ uses : pr-mpt/actions-commit-hash@v2
123
150
124
151
- name : Create release
125
152
id : create_release
126
- if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
127
153
uses : zendesk/action-create-release@v1
128
154
env :
129
155
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
130
156
with :
131
- tag_name : ${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}
157
+ tag_name : ${{ steps.commit.outputs.short }}
132
158
133
- - name : Upload release
134
- id : upload_release
135
- if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
159
+ - name : Upload windows release
136
160
uses : actions/upload-release-asset@v1
137
161
env :
138
162
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
139
163
with :
140
164
upload_url : ${{ steps.create_release.outputs.upload_url }}
141
- asset_path : .\ alpaca-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin- win-x64 .zip
142
- asset_name : alpaca-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin- win-x64 .zip
165
+ asset_path : windows/ alpaca-win.zip
166
+ asset_name : alpaca-win.zip
143
167
asset_content_type : application/octet-stream
144
168
145
- # ubuntu-latest-gcc:
146
- # runs-on: ubuntu-latest
147
- #
148
- # strategy:
149
- # matrix:
150
- # build: [Debug, Release]
151
- #
152
- # steps:
153
- # - name: Clone
154
- # uses: actions/checkout@v1
155
- #
156
- # - name: Dependencies
157
- # run: |
158
- # sudo apt-get update
159
- # sudo apt-get install build-essential
160
- # sudo apt-get install cmake
161
- #
162
- # - name: Configure
163
- # run: cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }}
164
- #
165
- # - name: Build
166
- # run: |
167
- # make
168
- #
169
- # ubuntu-latest-clang:
170
- # runs-on: ubuntu-latest
171
- #
172
- # strategy:
173
- # matrix:
174
- # build: [Debug, Release]
175
- #
176
- # steps:
177
- # - name: Clone
178
- # uses: actions/checkout@v1
179
- #
180
- # - name: Dependencies
181
- # run: |
182
- # sudo apt-get update
183
- # sudo apt-get install build-essential
184
- # sudo apt-get install cmake
185
- #
186
- # - name: Configure
187
- # run: cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
188
- #
189
- # - name: Build
190
- # run: |
191
- # make
192
- #
193
- # ubuntu-latest-gcc-sanitized:
194
- # runs-on: ubuntu-latest
195
- #
196
- # strategy:
197
- # matrix:
198
- # sanitizer: [ADDRESS, THREAD, UNDEFINED]
199
- #
200
- # steps:
201
- # - name: Clone
202
- # uses: actions/checkout@v1
203
- #
204
- # - name: Dependencies
205
- # run: |
206
- # sudo apt-get update
207
- # sudo apt-get install build-essential
208
- # sudo apt-get install cmake
209
- #
210
- # - name: Configure
211
- # run: cmake . -DCMAKE_BUILD_TYPE=Debug -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON
212
- #
213
- # - name: Build
214
- # run: |
215
- # make
216
- #
217
- # windows:
218
- # runs-on: windows-latest
219
- #
220
- # strategy:
221
- # matrix:
222
- # build: [Release]
223
- # arch: [Win32, x64]
224
- # include:
225
- # - arch: Win32
226
- # s2arc: x86
227
- # - arch: x64
228
- # s2arc: x64
229
- #
230
- # steps:
231
- # - name: Clone
232
- # uses: actions/checkout@v1
233
- #
234
- # - name: Add msbuild to PATH
235
- # uses: microsoft/setup-msbuild@v1
236
- #
237
- # - name: Configure
238
- # run: >
239
- # cmake -S . -B ./build -A ${{ matrix.arch }}
240
- # -DCMAKE_BUILD_TYPE=${{ matrix.build }}
241
- #
242
- # - name: Build
243
- # run: |
244
- # cd ./build
245
- # msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }}
246
- #
247
- # - name: Upload binaries
248
- # uses: actions/upload-artifact@v1
249
- # with:
250
- # name: llama-bin-${{ matrix.arch }}
251
- # path: build/bin/${{ matrix.build }}
252
- #
253
- # windows-blas:
254
- # runs-on: windows-latest
255
- #
256
- # strategy:
257
- # matrix:
258
- # build: [Release]
259
- # arch: [Win32, x64]
260
- # blas: [ON]
261
- # include:
262
- # - arch: Win32
263
- # obzip: https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x86.zip
264
- # s2arc: x86
265
- # - arch: x64
266
- # obzip: https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x64.zip
267
- # s2arc: x64
268
- #
269
- # steps:
270
- # - name: Clone
271
- # uses: actions/checkout@v1
272
- #
273
- # - name: Add msbuild to PATH
274
- # uses: microsoft/setup-msbuild@v1
275
- #
276
- # - name: Fetch OpenBLAS
277
- # if: matrix.blas == 'ON'
278
- # run: |
279
- # C:/msys64/usr/bin/wget.exe -qO blas.zip ${{ matrix.obzip }}
280
- # 7z x blas.zip -oblas -y
281
- # copy blas/include/cblas.h .
282
- # copy blas/include/openblas_config.h .
283
- # echo "blasdir=$env:GITHUB_WORKSPACE/blas" >> $env:GITHUB_ENV
284
- #
285
- # - name: Configure
286
- # run: >
287
- # cmake -S . -B ./build -A ${{ matrix.arch }}
288
- # -DCMAKE_BUILD_TYPE=${{ matrix.build }}
289
- # -DLLAMA_SUPPORT_OPENBLAS=${{ matrix.blas }}
290
- # -DCMAKE_LIBRARY_PATH="$env:blasdir/lib"
291
- #
292
- # - name: Build
293
- # run: |
294
- # cd ./build
295
- # msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }}
296
- #
297
- # - name: Copy libopenblas.dll
298
- # if: matrix.blas == 'ON'
299
- # run: copy "$env:blasdir/bin/libopenblas.dll" build/bin/${{ matrix.build }}
300
- #
301
- # - name: Upload binaries
302
- # if: matrix.blas == 'ON'
303
- # uses: actions/upload-artifact@v1
304
- # with:
305
- # name: llama-blas-bin-${{ matrix.arch }}
306
- # path: build/bin/${{ matrix.build }}
307
- #
308
- # emscripten:
309
- # runs-on: ubuntu-latest
310
- #
311
- # strategy:
312
- # matrix:
313
- # build: [Release]
314
- #
315
- # steps:
316
- # - name: Clone
317
- # uses: actions/checkout@v1
318
- #
319
- # - name: Dependencies
320
- # run: |
321
- # wget -q https://github.com/emscripten-core/emsdk/archive/master.tar.gz
322
- # tar -xvf master.tar.gz
323
- # emsdk-master/emsdk update
324
- # emsdk-master/emsdk install latest
325
- # emsdk-master/emsdk activate latest
326
- #
327
- # - name: Configure
328
- # run: echo "tmp"
329
- #
330
- # - name: Build
331
- # run: |
332
- # pushd emsdk-master
333
- # source ./emsdk_env.sh
334
- # popd
335
- # emcmake cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }}
336
- # make
169
+ - name : Upload mac release
170
+ uses : actions/upload-release-asset@v1
171
+ env :
172
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
173
+ with :
174
+ upload_url : ${{ steps.create_release.outputs.upload_url }}
175
+ asset_path : macos/alpaca-mac.zip
176
+ asset_name : alpaca-mac.zip
177
+ asset_content_type : application/octet-stream
178
+
179
+ - name : Upload linux release
180
+
181
+ uses : actions/upload-release-asset@v1
182
+ env :
183
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
184
+ with :
185
+ upload_url : ${{ steps.create_release.outputs.upload_url }}
186
+ asset_path : linux/alpaca-linux.zip
187
+ asset_name : alpaca-linux.zip
188
+ asset_content_type : application/octet-stream
0 commit comments