|
| 1 | +name: "Release" |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - '*' |
| 7 | + |
| 8 | +jobs: |
| 9 | + package_comfy_windows: |
| 10 | + permissions: |
| 11 | + contents: "write" |
| 12 | + packages: "write" |
| 13 | + pull-requests: "read" |
| 14 | + runs-on: windows-latest |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + python_version: [3.11.8, 3.12.8] |
| 18 | + cuda_version: [118, 122] |
| 19 | + steps: |
| 20 | + - name: Calculate Minor Version |
| 21 | + run: | |
| 22 | + echo "MINOR_VERSION=$(echo "${{ matrix.python_version }}" | cut -d'.' -f2)" >> $GITHUB_ENV |
| 23 | + - uses: actions/cache/restore@v3 |
| 24 | + id: cache |
| 25 | + with: |
| 26 | + path: | |
| 27 | + cu${{ matrix.cu }}_python_deps.tar |
| 28 | + update_comfyui_and_python_dependencies.bat |
| 29 | + key: ${{ runner.os }}-build-cu${{ matrix.cu }}-${{ env.MINOR_VERSION }} |
| 30 | + - shell: bash |
| 31 | + run: | |
| 32 | + mv cu${{ matrix.cu }}_python_deps.tar ../ |
| 33 | + mv update_comfyui_and_python_dependencies.bat ../ |
| 34 | + cd .. |
| 35 | + tar xf cu${{ matrix.cu }}_python_deps.tar |
| 36 | + pwd |
| 37 | + ls |
| 38 | + - name: Checkout code |
| 39 | + uses: actions/checkout@v4 |
| 40 | + with: |
| 41 | + fetch-depth: 0 |
| 42 | + - shell: bash |
| 43 | + run: | |
| 44 | + cd .. |
| 45 | + cp -r ComfyUI ComfyUI_copy |
| 46 | + curl https://www.python.org/ftp/python/${{ matrix.python_version }}/python-3.${{ matrix.python_version }}-embed-amd64.zip -o python_embeded.zip |
| 47 | + unzip python_embeded.zip -d python_embeded |
| 48 | + minor_version=$(echo "${{ matrix.python_version }}" | cut -d'.' -f2) |
| 49 | + cd python_embeded |
| 50 | + echo 'import site' >> ./python3${{ env.MINOR_VERSION }}._pth |
| 51 | + curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py |
| 52 | + ./python.exe get-pip.py |
| 53 | + ./python.exe -s -m pip install ../cu${{ matrix.cu }}_python_deps/* |
| 54 | + sed -i '1i../ComfyUI' ./python3${{ env.MINOR_VERSION }}._pth |
| 55 | + cd .. |
| 56 | +
|
| 57 | + git clone https://github.com/comfyanonymous/taesd |
| 58 | + cp taesd/*.pth ./ComfyUI_copy/models/vae_approx/ |
| 59 | +
|
| 60 | + mkdir ComfyUI_windows_portable |
| 61 | + mv python_embeded ComfyUI_windows_portable |
| 62 | + mv ComfyUI_copy ComfyUI_windows_portable/ComfyUI |
| 63 | +
|
| 64 | + cd ComfyUI_windows_portable |
| 65 | +
|
| 66 | + mkdir update |
| 67 | + cp -r ComfyUI/.ci/update_windows/* ./update/ |
| 68 | + cp -r ComfyUI/.ci/windows_base_files/* ./ |
| 69 | + cp ../update_comfyui_and_python_dependencies.bat ./update/ |
| 70 | +
|
| 71 | + cd .. |
| 72 | +
|
| 73 | + "C:\Program Files\7-Zip\7z.exe" a -t7z -m0=lzma -mx=8 -mfb=64 -md=32m -ms=on -mf=BCJ2 ComfyUI_windows_portable.7z ComfyUI_windows_portable |
| 74 | + mv ComfyUI_windows_portable.7z ComfyUI/new_ComfyUI_windows_portable_nvidia_cu${{ matrix.cu }}_or_cpu.7z |
| 75 | +
|
| 76 | + cd ComfyUI_windows_portable |
| 77 | + python_embeded/python.exe -s ComfyUI/main.py --quick-test-for-ci --cpu |
| 78 | +
|
| 79 | + ls |
| 80 | +
|
| 81 | + - name: Upload binaries to release |
| 82 | + uses: svenstaro/upload-release-action@v2 |
| 83 | + with: |
| 84 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 85 | + file: new_ComfyUI_windows_portable_nvidia_cu${{ matrix.cu }}.7z |
| 86 | + tag: "latest" |
| 87 | + overwrite: true |
0 commit comments