Build InvokeAI #40
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 InvokeAI | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- ".github/workflows/build_invokeai.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: '30 16 * * 0' | |
workflow_dispatch: | |
jobs: | |
Build-InvokeAI: | |
name: Build InvokeAI | |
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 InvokeAI Installer | |
shell: pwsh | |
env: | |
UV_NO_PROGRESS: 1 | |
run: | | |
& "${{ github.workspace }}/invokeai_installer.ps1" ` | |
-InstallPath "${{ github.workspace }}/invokeai" ` | |
-BuildMode ` | |
-BuildWithUpdate ` | |
-BuildWithLaunch ` | |
-DisablePyPIMirror ` | |
-DisableGithubMirror ` | |
-DisableHuggingFaceMirror | |
- name: Make docs | |
shell: pwsh | |
run: | | |
python "${{ github.workspace }}/.github/make_docs.py" "${{ github.workspace }}/invokeai" | |
- name: Archive | |
shell: pwsh | |
run: | | |
$build_time = (Get-Date).ToUniversalTime().AddHours(8).ToString("yyyyMMdd") | |
$package_name = "invokeai_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 }}/invokeai" -Destination "${{ github.workspace }}/${package_name}" -Force | |
7z a -t7z -bsp1 "${{ github.workspace }}/sdnote/portable/nightly/invokeai/${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" |