From b8bb253c28375623a09075a264446263cb32cb67 Mon Sep 17 00:00:00 2001 From: "Join.G" Date: Sat, 2 Nov 2024 17:27:56 +0800 Subject: [PATCH] extract the lib file, and achive it --- .github/workflows/build.yaml | 2 +- Dockerfile | 4 +++- Makefile | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3ffbaeb..e646a2d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -39,7 +39,7 @@ jobs: - name: Extract run: | make extract_wasi - tar czvf whisper.wasm.tar.gz whisper.wasm + tar czvf whisper.wasm.tar.gz whisper.wasm libwhisper.a - name: upload artifact uses: actions/upload-release-asset@v1 env: diff --git a/Dockerfile b/Dockerfile index 7c105ee..a8dfd58 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,11 +12,13 @@ RUN mkdir ./build /out -p && \ cd build && \ cmake ../ -DLLAMA_ACCELERATE=OFF -DGGML_NO_ACCELERATE=ON -DWHISPER_BUILD_EXAMPLES=ON -DCMAKE_TOOLCHAIN_FILE=${WASI_SDK}/share/cmake/wasi-sdk-pthread.cmake &&\ make && \ - mv bin/main /out/whisper.wasm + mv bin/main /out/whisper.wasm &&\\ + mv libwhisper.a /out/libwhisper.a RUN /work/binaryen/bin/wasm-opt -O3 -o /out/whisper.wasm /out/whisper.wasm FROM scratch as whisper COPY --link --from=maker /out/whisper.wasm /whisper.wasm +COPY --link --from=maker /out/libwhisper.a /libwhisper.a diff --git a/Makefile b/Makefile index 4579fd2..78a6c9f 100644 --- a/Makefile +++ b/Makefile @@ -18,4 +18,5 @@ push: extract_wasi: docker run --name tmp.container.${IMAGE_NAME} ghcr.io/blocklessnetwork/${IMAGE_NAME}:${IMAGE_TAG_VERSION} ls || echo 1 docker ps -a - docker cp tmp.container.${IMAGE_NAME}:/whisper.wasm . \ No newline at end of file + docker cp tmp.container.${IMAGE_NAME}:/whisper.wasm . + docker cp tmp.container.${IMAGE_NAME}:/libwhisper.a . \ No newline at end of file