Build Fooocus #28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Fooocus | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- ".github/workflows/build_fooocus.yml" | |
# delete: | |
# create: | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
# UTC 17:00 -> CST (China) 1:00, see https://datetime360.com/cn/utc-cst-china-time/ | |
# https://docs.github.com/zh/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule | |
- cron: '15 16 * * 0' | |
workflow_dispatch: | |
jobs: | |
Build-Fooocus: | |
name: Build Fooocus | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: List files in the repository | |
shell: pwsh | |
run: | | |
Get-ChildItem -Path "${{ github.workspace }}" -Recurse | |
- name: Launch Fooocus Installer | |
shell: pwsh | |
env: | |
UV_NO_PROGRESS: 1 | |
run: | | |
& "${{ github.workspace }}/fooocus_installer.ps1" ` | |
-InstallPath "${{ github.workspace }}/fooocus" ` | |
-BuildMode ` | |
-BuildWithUpdate ` | |
-BuildWithLaunch ` | |
-InstallBranch "fooocus" ` | |
-DisablePyPIMirror ` | |
-DisableGithubMirror ` | |
-DisableHuggingFaceMirror ` | |
-NoPreDownloadModel ` | |
-PyTorchPackage "torch==2.7.0+cu128 torchvision==0.22.0+cu128 torchaudio==2.7.0+cu128" ` | |
-xFormersPackage "xformers==0.0.30" | |
- name: Install Hanamizuki | |
shell: pwsh | |
run: | | |
. "${{ github.workspace }}/fooocus/activate.ps1" | |
Install-Hanamizuki | |
- name: Make docs | |
shell: pwsh | |
run: | | |
python "${{ github.workspace }}/.github/make_docs.py" "${{ github.workspace }}/fooocus" | |
- name: Archive | |
shell: pwsh | |
run: | | |
$build_time = (Get-Date).ToUniversalTime().AddHours(8).ToString("yyyyMMdd") | |
$package_name = "fooocus_licyk_${build_time}" | |
$protable_name = "${package_name}_nightly.7z" | |
New-Item -ItemType Directory -Path "${{ github.workspace }}/sdnote/portable/nightly" -Force | |
Move-Item -Path "${{ github.workspace }}/fooocus" -Destination "${{ github.workspace }}/${package_name}" -Force | |
7z a -t7z -bsp1 "${{ github.workspace }}/sdnote/portable/nightly/fooocus/${protable_name}" "${{ github.workspace }}/${package_name}" | |
- name: Install HuggingFace and ModelScope library | |
shell: pwsh | |
env: | |
PIP_DISABLE_PIP_VERSION_CHECK: 1 | |
run: | | |
pip install huggingface_hub modelscope | |
- name: Upload to HuggingFace repo | |
shell: pwsh | |
env: | |
HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
WORKSPACE: ${{ github.workspace }} | |
run: | | |
python "${{ github.workspace }}/.github/huggingface_release.py" | |
- name: Upload to ModelScope repo | |
shell: pwsh | |
env: | |
MODELSCOPE_API_TOKEN: ${{ secrets.MODELSCOPE_API_TOKEN }} | |
WORKSPACE: ${{ github.workspace }} | |
run: | | |
python "${{ github.workspace }}/.github/modelscope_release.py" |