Skip to content

Build and Package (CPU) #54

Build and Package (CPU)

Build and Package (CPU) #54

name: Build and Package (CPU)
on:
release:
types:
- published
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download and Install Miniconda
run: |
curl -o miniconda-installer.exe https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe
start /wait "" miniconda-installer.exe /S /D=C:\programs\miniconda3
del miniconda-installer.exe
shell: cmd
- name: Set up Conda environment
run: |
C:\programs\miniconda3\Scripts\conda create -n py310 python=3.10.11 --yes
shell: cmd
- name: Activate Conda environment and Install Dependencies
run: |
call C:\programs\miniconda3\Scripts\activate C:\programs\miniconda3\envs\py310
pip install --no-cache-dir torch==2.2.1 --extra-index-url https://download.pytorch.org/whl/cpu
pip install --extra-index-url https://pypi.artrajz.cn/simple -r requirements.txt
shell: cmd
- name: Pre download nltk data
run: |
curl -o nltk_data.zip https://github.com/Artrajz/archived/raw/main/nltk/nltk_data.zip
tar -xf nltk_data.zip -C C:\Programs\Miniconda3\envs\py310
del nltk_data.zip
shell: cmd
- name: Copy python environment
run: |
XCOPY C:\programs\miniconda3\envs\py310 py310\ /E /Y /F
shell: cmd
- name: Create 'start.bat'
run: |
echo @echo off >> start.bat
echo py310\python.exe app.py >> start.bat
echo pause >> start.bat
shell: cmd
- name: Create 7z Archive
run: |
7z a -t7z -m0=LZMA "vits-simple-api-windows-cpu-${{ github.event.release.tag_name }}.7z" .
shell: cmd
- name: Upload Release Artifacts
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
vits-simple-api-windows-cpu-${{ github.event.release.tag_name }}.7z
token: ${{ secrets.RELEASE_TOKEN }}