mirror of
https://github.com/YaoFANGUK/video-subtitle-remover.git
synced 2026-02-04 04:34:41 +08:00
94 lines
3.6 KiB
YAML
94 lines
3.6 KiB
YAML
name: Build Windows CUDA 11.8
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '**'
|
|
workflow_dispatch:
|
|
inputs:
|
|
ssh:
|
|
description: 'SSH connection to Actions'
|
|
required: false
|
|
default: false
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: windows-2019
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: 读取 VERSION
|
|
id: version
|
|
run: |
|
|
VERSION=$(sed -n 's/^VERSION = "\(.*\)"/\1/p' backend/config.py)
|
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
|
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
|
shell: bash
|
|
# - name: 检查 tag 是否已存在
|
|
# run: |
|
|
# TAG_NAME="${VERSION}"
|
|
# if git ls-remote --tags origin | grep -q "refs/tags/$TAG_NAME"; then
|
|
# echo "Tag $TAG_NAME 已存在,发布中止"
|
|
# exit 1
|
|
# fi
|
|
# shell: bash
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
cache: 'pip' # caching pip dependencies
|
|
- run: pip install paddlepaddle==3.0.0
|
|
- run: pip install -r requirements.txt
|
|
- run: pip freeze > requirements.txt
|
|
- run: pip install torch==2.7.0 torchvision==0.22.0 --index-url https://download.pytorch.org/whl/cu118
|
|
- run: pip install QPT==1.0b8 setuptools
|
|
- name: 获取 site-packages 路径
|
|
shell: bash
|
|
run: |
|
|
SITE_PACKAGES=$(python -c "import site, os; print(os.path.join(site.getsitepackages()[0], 'Lib', 'site-packages'))")
|
|
SITE_PACKAGES_UNIX=$(cygpath -u "$SITE_PACKAGES")
|
|
echo "site-packages路径: $SITE_PACKAGES"
|
|
echo "site-packages UNIX路径: $SITE_PACKAGES_UNIX"
|
|
echo "SITE_PACKAGES_UNIX=$SITE_PACKAGES_UNIX" >> $GITHUB_ENV
|
|
echo "SITE_PACKAGES=$SITE_PACKAGES" >> $GITHUB_ENV
|
|
- name: 修复QPT内部错误
|
|
run: sed -i '98c\ try:\n dep = pkg.requires()\n except TypeError:\n continue' ${SITE_PACKAGES_UNIX}/qpt/kernel/qpackage.py
|
|
shell: bash
|
|
- name: Start SSH via tmate
|
|
if: (github.event.inputs.ssh == 'true' && github.event.inputs.ssh != 'false') || contains(github.event.action, 'ssh')
|
|
uses: mxschmitt/action-tmate@v3
|
|
- run: |
|
|
python backend/tools/makedist.py --cuda 11.8 && \
|
|
mv ../vsr_out ./vsr_out && \
|
|
cp ./vsr_out/Debug/Debug-进入虚拟环境.cmd ./vsr_out/Release/
|
|
env:
|
|
QPT_Action: "True"
|
|
shell: bash
|
|
- name: 上传 Debug 文件夹到 Artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: vsr-v${{ env.VERSION }}-windows-nvidia-cuda-11.8-debug
|
|
path: vsr_out/Debug/
|
|
- name: 上传 Release 文件夹到 Artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: vsr-v${{ env.VERSION }}-windows-nvidia-cuda-11.8-release
|
|
path: vsr_out/Release/
|
|
- name: 打包 Release 文件夹
|
|
run: |
|
|
cd vsr_out/Release
|
|
7z a -t7z -mx=9 -m0=LZMA2 -ms=on -mfb=64 -md=32m -mmt=on -v2000m vsr-v${{ env.VERSION }}-windows-nvidia-cuda-11.8.7z * && \
|
|
# 检测是否只有一个分卷
|
|
if [ -f vsr-v${{ env.VERSION }}-windows-nvidia-cuda-11.8.7z.001 ] && [ ! -f vsr-v${{ env.VERSION }}-windows-nvidia-cuda-11.8.7z.002 ]; then \
|
|
mv vsr-v${{ env.VERSION }}-windows-nvidia-cuda-11.8.7z.001 vsr-v${{ env.VERSION }}-windows-nvidia-cuda-11.8.7z; fi
|
|
shell: bash
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
prerelease: true
|
|
tag_name: ${{ env.VERSION }}
|
|
target_commitish: ${{ github.sha }}
|
|
name: 硬字幕去除器 v${{ env.VERSION }}
|
|
files: |
|
|
vsr_out/Release/vsr-v${{ env.VERSION }}-windows-nvidia-cuda-11.8.7z* |