|
| 1 | + |
| 2 | +name: "Release Stable Version" |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + git_tag: |
| 8 | + description: 'Git tag' |
| 9 | + required: true |
| 10 | + type: string |
| 11 | + cu: |
| 12 | + description: 'CUDA version' |
| 13 | + required: true |
| 14 | + type: string |
| 15 | + default: "121" |
| 16 | + python_minor: |
| 17 | + description: 'Python minor version' |
| 18 | + required: true |
| 19 | + type: string |
| 20 | + default: "11" |
| 21 | + python_patch: |
| 22 | + description: 'Python patch version' |
| 23 | + required: true |
| 24 | + type: string |
| 25 | + default: "9" |
| 26 | + |
| 27 | + |
| 28 | +jobs: |
| 29 | + package_comfy_windows: |
| 30 | + permissions: |
| 31 | + contents: "write" |
| 32 | + packages: "write" |
| 33 | + pull-requests: "read" |
| 34 | + runs-on: windows-latest |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v4 |
| 37 | + with: |
| 38 | + ref: ${{ inputs.git_tag }} |
| 39 | + fetch-depth: 0 |
| 40 | + persist-credentials: false |
| 41 | + - uses: actions/cache/restore@v4 |
| 42 | + id: cache |
| 43 | + with: |
| 44 | + path: | |
| 45 | + cu${{ inputs.cu }}_python_deps.tar |
| 46 | + update_comfyui_and_python_dependencies.bat |
| 47 | + key: ${{ runner.os }}-build-cu${{ inputs.cu }}-${{ inputs.python_minor }} |
| 48 | + - shell: bash |
| 49 | + run: | |
| 50 | + mv cu${{ inputs.cu }}_python_deps.tar ../ |
| 51 | + mv update_comfyui_and_python_dependencies.bat ../ |
| 52 | + cd .. |
| 53 | + tar xf cu${{ inputs.cu }}_python_deps.tar |
| 54 | + pwd |
| 55 | + ls |
| 56 | +
|
| 57 | + - shell: bash |
| 58 | + run: | |
| 59 | + cd .. |
| 60 | + cp -r ComfyUI ComfyUI_copy |
| 61 | + curl https://www.python.org/ftp/python/3.${{ inputs.python_minor }}.${{ inputs.python_patch }}/python-3.${{ inputs.python_minor }}.${{ inputs.python_patch }}-embed-amd64.zip -o python_embeded.zip |
| 62 | + unzip python_embeded.zip -d python_embeded |
| 63 | + cd python_embeded |
| 64 | + echo ${{ env.MINOR_VERSION }} |
| 65 | + echo 'import site' >> ./python3${{ inputs.python_minor }}._pth |
| 66 | + curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py |
| 67 | + ./python.exe get-pip.py |
| 68 | + ./python.exe -s -m pip install ../cu${{ inputs.cu }}_python_deps/* |
| 69 | + sed -i '1i../ComfyUI' ./python3${{ inputs.python_minor }}._pth |
| 70 | + cd .. |
| 71 | +
|
| 72 | + git clone --depth 1 https://github.com/comfyanonymous/taesd |
| 73 | + cp taesd/*.pth ./ComfyUI_copy/models/vae_approx/ |
| 74 | +
|
| 75 | + mkdir ComfyUI_windows_portable |
| 76 | + mv python_embeded ComfyUI_windows_portable |
| 77 | + mv ComfyUI_copy ComfyUI_windows_portable/ComfyUI |
| 78 | +
|
| 79 | + cd ComfyUI_windows_portable |
| 80 | +
|
| 81 | + mkdir update |
| 82 | + cp -r ComfyUI/.ci/update_windows/* ./update/ |
| 83 | + cp -r ComfyUI/.ci/windows_base_files/* ./ |
| 84 | + cp ../update_comfyui_and_python_dependencies.bat ./update/ |
| 85 | +
|
| 86 | + cd .. |
| 87 | +
|
| 88 | + "C:\Program Files\7-Zip\7z.exe" a -t7z -m0=lzma2 -mx=8 -mfb=64 -md=32m -ms=on -mf=BCJ2 ComfyUI_windows_portable.7z ComfyUI_windows_portable |
| 89 | + mv ComfyUI_windows_portable.7z ComfyUI/ComfyUI_windows_portable_nvidia.7z |
| 90 | +
|
| 91 | + cd ComfyUI_windows_portable |
| 92 | + python_embeded/python.exe -s ComfyUI/main.py --quick-test-for-ci --cpu |
| 93 | +
|
| 94 | + ls |
| 95 | +
|
| 96 | + - name: Upload binaries to release |
| 97 | + uses: svenstaro/upload-release-action@v2 |
| 98 | + with: |
| 99 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 100 | + file: ComfyUI_windows_portable_nvidia.7z |
| 101 | + tag: ${{ inputs.git_tag }} |
| 102 | + overwrite: true |
| 103 | + prerelease: true |
| 104 | + make_latest: false |
0 commit comments