From 9967408b0ff06b20b9db7fd386f35dcd35d42536 Mon Sep 17 00:00:00 2001 From: jinbridge <2635480475@qq.com> Date: Mon, 4 Mar 2024 11:47:34 +0800 Subject: [PATCH] build portable zip --- .../workflows/bigdl-build-portable-zip.yml | 20 +++++++++++++++++-- python/llm/portable-zip/setup.bat | 12 ++++++++--- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bigdl-build-portable-zip.yml b/.github/workflows/bigdl-build-portable-zip.yml index 50b86a857c5..a9bac241675 100644 --- a/.github/workflows/bigdl-build-portable-zip.yml +++ b/.github/workflows/bigdl-build-portable-zip.yml @@ -32,5 +32,21 @@ jobs: with: name: cpython-3.9-embed-zip path: ./PCbuild/amd64/en-us/cpython-embed-zip.zip - - \ No newline at end of file + build-portable-zip: + needs: build-cpython + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: cpython-3.9-embed-zip + path: ./python/llm/portable-zip/ + - name: Build Portable Zip + shell: cmd + run: | + cd .\python\llm\portable-zip + setup.bat --python-zip + - uses: actions/upload-artifact@v4 + with: + name: portable-zip + path: ./python/llm/portable-zip/bigdl-llm.zip diff --git a/python/llm/portable-zip/setup.bat b/python/llm/portable-zip/setup.bat index b509a2b2eb6..f428275edd6 100644 --- a/python/llm/portable-zip/setup.bat +++ b/python/llm/portable-zip/setup.bat @@ -1,7 +1,13 @@ :: download python and extract zip -powershell -Command "Start-BitsTransfer -Source https://www.python.org/ftp/python/3.9.13/python-3.9.13-embed-amd64.zip -Destination python-3.9.13-embed-amd64.zip" -powershell -Command "Expand-Archive .\python-3.9.13-embed-amd64.zip -DestinationPath .\python-embed" -del .\python-3.9.13-embed-amd64.zip +if "%1"=="--python-zip" ( + powershell -Command "Expand-Archive .\cpython-3.9-embed-zip.zip -DestinationPath ." + powershell -Command "Expand-Archive .\cpython-embed-zip.zip -DestinationPath .\python-embed" +) else ( + powershell -Command "Start-BitsTransfer -Source https://www.python.org/ftp/python/3.9.13/python-3.9.13-embed-amd64.zip -Destination python-3.9.13-embed-amd64.zip" + powershell -Command "Expand-Archive .\python-3.9.13-embed-amd64.zip -DestinationPath .\python-embed" + del .\python-3.9.13-embed-amd64.zip +) + set "python-embed=.\python-embed\python.exe"