Pre-Compiled and Upload #25
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: Pre-Compiled and Upload | |
| on: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| Windows: | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| .\run-install.bat | |
| .\env\python.exe core.py "prerequisites" --pretraineds_hifigan "True" --models "True" --exe "True" | |
| - name: Clean up unnecessary files | |
| run: | | |
| Remove-Item -Path 'LICENSE', 'run-tensorboard.sh', 'run-install.sh', 'run-applio.sh', 'run-install.bat', 'requirements.txt', '.gitignore', '.github', '.git' -Recurse -Force -ErrorAction SilentlyContinue | |
| Get-ChildItem -Path . -Include __pycache__ -Recurse -Directory | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue | |
| - name: Read version from config.json | |
| id: get-version | |
| run: | | |
| $version = (Get-Content -Path './assets/config.json' | ConvertFrom-Json).version | |
| echo "version=$version" >> $env:GITHUB_OUTPUT | |
| - name: Create ZIP file | |
| run: | | |
| $version = '${{ steps.get-version.outputs.version }}' | |
| Compress-Archive -Path 'D:\a\Applio\Applio\*' -DestinationPath "D:\a\Applio\ApplioV$version.zip" | |
| - name: Upload Windows Compiled | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| version: ${{ steps.get-version.outputs.version }} | |
| run: | | |
| .\env\python.exe -c " | |
| import os | |
| from huggingface_hub import login, upload_file | |
| token = os.getenv('HF_TOKEN') | |
| version = os.getenv('version') | |
| login(token) | |
| repo_id = 'IAHispano/Applio' | |
| repo_file_path = f'D:/a/Applio/ApplioV{version}.zip' | |
| upload_file( | |
| commit_message=f'{version}', | |
| path_or_fileobj=repo_file_path, | |
| path_in_repo=f'Compiled/Windows/ApplioV{version}.zip', | |
| repo_id=repo_id, | |
| token=token) | |
| " |