From 904f4dc89ae4873c4adacd1237d1656219a15bdb Mon Sep 17 00:00:00 2001 From: YAN Wenkun Date: Mon, 1 Apr 2024 11:13:07 +0800 Subject: [PATCH] new 3-in-1 build workflow --- .github/workflows/build.yml | 14 ++++++++++---- stage1.sh | 4 ++++ stage2.sh | 8 +------- stage3.sh | 12 ++++++++++++ 4 files changed, 27 insertions(+), 11 deletions(-) create mode 100644 stage3.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b8d430d..2fff50e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,11 +9,17 @@ jobs: steps: - uses: actions/checkout@v4 - - shell: bash - run: bash step1.sh + - name: Stage 1 Gathering Dependencies + shell: bash + run: bash stage1.sh - - shell: bash - run: bash step2.sh + - name: Stage 2 Assembling Repositories + shell: bash + run: bash stage2.sh + + - name: Stage 3 Compressing Package + shell: bash + run: bash stage3.sh - name: Upload archive to release uses: xresloader/upload-to-github-release@v1 diff --git a/stage1.sh b/stage1.sh index d08a6bf..026dd89 100644 --- a/stage1.sh +++ b/stage1.sh @@ -7,6 +7,8 @@ workdir=$(pwd) export PYTHONPYCACHEPREFIX="$workdir"/pycache +ls -lahF + # Setup Python embeded, part 1/3 curl https://www.python.org/ftp/python/3.11.8/python-3.11.8-embed-amd64.zip \ -o python_embeded.zip @@ -61,6 +63,8 @@ rm -rf "$workdir"/ComfyUI-3D-Pack # Setup Python embeded, part 3/3 sed -i '1i../ComfyUI' ./python311._pth +./python.exe -s -m pip list + cd "$workdir" du -hd1 diff --git a/stage2.sh b/stage2.sh index 220cb67..a40bdcd 100644 --- a/stage2.sh +++ b/stage2.sh @@ -7,7 +7,7 @@ workdir=$(pwd) export PYTHONPYCACHEPREFIX="$workdir"/pycache -du -hd1 +ls -lahF mkdir -p "$workdir"/ComfyUI_Windows_portable @@ -85,12 +85,6 @@ rm ./ComfyUI-Manager/config.ini rm ./ComfyUI-Impact-Pack/impact-pack.ini rm ./ComfyUI-Custom-Scripts/pysssss.json -du -hd1 "$workdir" - -# Packaging cd "$workdir" -# LZMA2 is ~1.8x faster -"C:\Program Files\7-Zip\7z.exe" a -t7z -m0=lzma2 -mx=5 -mfb=32 -md=16m -ms=on -mf=BCJ2 -v2100000000b ComfyUI_Windows_portable_cu121.7z ComfyUI_Windows_portable -cd "$workdir" ls -lahF diff --git a/stage3.sh b/stage3.sh new file mode 100644 index 0000000..8007dc5 --- /dev/null +++ b/stage3.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eux + +ls -lahF + +du -hd1 + +# LZMA2 is ~75% faster than LZMA, but consumes more RAM +# Use 2140000000b as volume size just because GitHub think 2147483648b is "larger than 2GB" +"C:\Program Files\7-Zip\7z.exe" a -t7z -m0=lzma2 -mx=7 -mfb=64 -md=32m -ms=on -mf=BCJ2 -v2140000000b ComfyUI_Windows_portable_cu121.7z ComfyUI_Windows_portable + +ls -lahF