Build Executables #11
Workflow file for this run
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 Executables | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade "pip<24.1" | |
| pip install pyinstaller | |
| pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu | |
| pip install omegaconf==2.0.6 --no-deps | |
| pip install PyYAML antlr4-python3-runtime hydra-core | |
| pip install fairseq==0.12.2 --no-deps | |
| pip install gradio==3.50.2 librosa soundfile scipy numpy praat-parselmouth pyworld torchcrepe faiss-cpu tqdm requests python-dotenv colorama demucs huggingface_hub pedalboard ffmpeg-python av | |
| - name: Download base models | |
| run: | | |
| $env:PYTHONIOENCODING="utf-8" | |
| python tools/download_models.py | |
| shell: pwsh | |
| - name: Build Windows executable | |
| run: | | |
| pyinstaller --name AI-RVC-Windows ` | |
| --onefile ` | |
| --add-data "ui;ui" ` | |
| --add-data "infer;infer" ` | |
| --add-data "lib;lib" ` | |
| --add-data "models;models" ` | |
| --add-data "tools;tools" ` | |
| --add-data "i18n;i18n" ` | |
| --add-data "configs;configs" ` | |
| --add-data "assets/hubert;assets/hubert" ` | |
| --add-data "assets/rmvpe;assets/rmvpe" ` | |
| --hidden-import=torch ` | |
| --hidden-import=torchaudio ` | |
| --hidden-import=gradio ` | |
| --hidden-import=librosa ` | |
| --hidden-import=soundfile ` | |
| --hidden-import=fairseq ` | |
| --hidden-import=audio_separator ` | |
| --hidden-import=demucs ` | |
| --hidden-import=pedalboard ` | |
| --collect-all torch ` | |
| --collect-all torchaudio ` | |
| --collect-all gradio ` | |
| run.py | |
| shell: pwsh | |
| - name: Create portable package | |
| run: | | |
| mkdir AI-RVC-Windows-Portable | |
| copy dist\AI-RVC-Windows.exe AI-RVC-Windows-Portable\ | |
| copy README.md AI-RVC-Windows-Portable\ | |
| copy LICENSE AI-RVC-Windows-Portable\ | |
| echo "AI-RVC Windows Portable Version" > AI-RVC-Windows-Portable\README.txt | |
| echo "" >> AI-RVC-Windows-Portable\README.txt | |
| echo "Double click AI-RVC-Windows.exe to start" >> AI-RVC-Windows-Portable\README.txt | |
| echo "First launch will download required models (may take 5-10 minutes)" >> AI-RVC-Windows-Portable\README.txt | |
| echo "" >> AI-RVC-Windows-Portable\README.txt | |
| echo "Visit http://127.0.0.1:7860 in your browser after launch" >> AI-RVC-Windows-Portable\README.txt | |
| - name: Compress Windows package | |
| run: | | |
| 7z a -tzip AI-RVC-Windows-Portable.zip AI-RVC-Windows-Portable | |
| shell: pwsh | |
| - name: Upload Windows artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: AI-RVC-Windows | |
| path: AI-RVC-Windows-Portable.zip | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| libsndfile1 \ | |
| ffmpeg \ | |
| portaudio19-dev | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade "pip<24.1" | |
| pip install pyinstaller | |
| pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu | |
| pip install omegaconf==2.0.6 --no-deps | |
| pip install PyYAML antlr4-python3-runtime hydra-core | |
| pip install fairseq==0.12.2 --no-deps | |
| pip install gradio==3.50.2 librosa soundfile scipy numpy praat-parselmouth pyworld torchcrepe faiss-cpu tqdm requests python-dotenv colorama demucs huggingface_hub pedalboard ffmpeg-python av | |
| - name: Download base models | |
| run: | | |
| python tools/download_models.py | |
| - name: Build Linux executable | |
| run: | | |
| pyinstaller --name AI-RVC-Linux \ | |
| --onefile \ | |
| --add-data "ui:ui" \ | |
| --add-data "infer:infer" \ | |
| --add-data "lib:lib" \ | |
| --add-data "models:models" \ | |
| --add-data "tools:tools" \ | |
| --add-data "i18n:i18n" \ | |
| --add-data "configs:configs" \ | |
| --add-data "assets/hubert:assets/hubert" \ | |
| --add-data "assets/rmvpe:assets/rmvpe" \ | |
| --hidden-import=torch \ | |
| --hidden-import=torchaudio \ | |
| --hidden-import=gradio \ | |
| --hidden-import=librosa \ | |
| --hidden-import=soundfile \ | |
| --hidden-import=fairseq \ | |
| --hidden-import=audio_separator \ | |
| --hidden-import=demucs \ | |
| --hidden-import=pedalboard \ | |
| --collect-all torch \ | |
| --collect-all torchaudio \ | |
| --collect-all gradio \ | |
| run.py | |
| - name: Create portable package | |
| run: | | |
| mkdir AI-RVC-Linux-Portable | |
| cp dist/AI-RVC-Linux AI-RVC-Linux-Portable/ | |
| cp README.md AI-RVC-Linux-Portable/ | |
| cp LICENSE AI-RVC-Linux-Portable/ | |
| cat > AI-RVC-Linux-Portable/README.txt << EOF | |
| AI-RVC Linux Portable Version | |
| Run: ./AI-RVC-Linux | |
| First launch will download required models (may take 5-10 minutes) | |
| Visit http://127.0.0.1:7860 in your browser after launch | |
| Make executable: chmod +x AI-RVC-Linux | |
| EOF | |
| chmod +x AI-RVC-Linux-Portable/AI-RVC-Linux | |
| - name: Compress Linux package | |
| run: | | |
| tar -czf AI-RVC-Linux-Portable.tar.gz AI-RVC-Linux-Portable | |
| - name: Upload Linux artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: AI-RVC-Linux | |
| path: AI-RVC-Linux-Portable.tar.gz | |
| create-release: | |
| needs: [build-windows, build-linux] | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Download Windows artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: AI-RVC-Windows | |
| - name: Download Linux artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: AI-RVC-Linux | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| AI-RVC-Windows-Portable.zip | |
| AI-RVC-Linux-Portable.tar.gz | |
| body: | | |
| ## AI-RVC 便携版可执行文件 | |
| ### Windows | |
| - 下载 `AI-RVC-Windows-Portable.zip` | |
| - 解压 zip 文件 | |
| - 双击 `AI-RVC-Windows.exe` 启动 | |
| - 浏览器访问 http://127.0.0.1:7860 | |
| ### Linux | |
| - 下载 `AI-RVC-Linux-Portable.tar.gz` | |
| - 解压:`tar -xzf AI-RVC-Linux-Portable.tar.gz` | |
| - 添加执行权限:`chmod +x AI-RVC-Linux-Portable/AI-RVC-Linux` | |
| - 运行:`./AI-RVC-Linux-Portable/AI-RVC-Linux` | |
| - 浏览器访问 http://127.0.0.1:7860 | |
| ### 说明 | |
| - 首次启动需要下载模型文件(约 5-10 分钟) | |
| - 无需安装 Python | |
| - ⚠️ 便携版仅支持 CPU 推理(构建时使用 CPU 版 PyTorch 以控制包体积),处理速度较慢 | |
| - 如需 GPU 加速,请使用本地安装方式(`python install.py`) | |
| - 包含所有功能(翻唱、角色模型、混音预设等) | |
| ### 系统要求 | |
| - **Windows**:Windows 10/11 (x64) | |
| - **Linux**:Ubuntu 20.04+ / Debian 11+ (x64) | |
| - **内存**:建议 8GB+ | |
| - **磁盘**:需要 5GB+ 可用空间 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |