更新logo图片 #48
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 Windows CUDA 10.2 | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| workflow_dispatch: | |
| inputs: | |
| ssh: | |
| description: 'SSH connection to Actions' | |
| required: false | |
| default: false | |
| 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.11' | |
| cache: 'pip' # caching pip dependencies | |
| - name: 部署 CUDA | |
| uses: Jimver/cuda-toolkit@v0.2.21 | |
| id: cuda-toolkit | |
| with: | |
| cuda: '10.2.89' | |
| - run: echo "Installed cuda version is ${{steps.cuda-toolkit.outputs.cuda}}" | |
| - run: echo "Cuda install location ${{steps.cuda-toolkit.outputs.CUDA_PATH}}" | |
| - run: nvcc -V | |
| - run: git clean -df | |
| # 最后一个支持10.2版本的Paddle | |
| # https://www.paddlepaddle.org.cn/documentation/docs/en/2.5/install/Tables_en.html | |
| - run: python -m pip install paddlepaddle-gpu==2.5.2.post102 -f https://www.paddlepaddle.org.cn/whl/windows/mkl/avx/stable.html | |
| - run: sed -i 's/numpy==.*/numpy==1.26.4/g' requirements.txt | |
| shell: bash | |
| - run: pip install -r requirements.txt | |
| - run: | | |
| mv -fv requirements.txt requirements.txt.bak && \ | |
| pip freeze > requirements.txt | |
| shell: bash | |
| - 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=10.2 && \ | |
| mv ../vse_out ./vse_out && \ | |
| cp ./vse_out/Debug/Debug-进入虚拟环境.cmd ./vse_out/Release/ | |
| mv -fv requirements.txt.bak requirements.txt && \ | |
| pip download -d ./vse_out/Debug/opt/packages/ -r requirements.txt && \ | |
| # for paddlepaddle-gpu < 3.0.0 | |
| pip download -d./vse_out/Release/opt/packages/ numpy==1.26.4 && \ | |
| cp -rfv ./vse_out/Debug/opt/packages/* ./vse_out/Release/opt/packages/ && \ | |
| rm -fv ./vse_out/*/opt/packages/numpy-2* && \ | |
| rm -fv ./vse_out/*/opt/packages/paddlepaddle-* && \ | |
| rm -fv ./vse_out/*/opt/PaddlePaddlePackage/001-* | |
| env: | |
| QPT_Action: "True" | |
| CUDA_PATH_V10_2: "${{steps.cuda-toolkit.outputs.CUDA_PATH}}" | |
| shell: bash | |
| - name: 部署 CUDNN | |
| shell: bash | |
| run: | | |
| curl -L -o cudnn.zip "https://developer.download.nvidia.cn/compute/redist/cudnn/v7.6.5/cudnn-10.2-windows10-x64-v7.6.5.32.zip" && \ | |
| unzip -j cudnn.zip "*/bin/*" -d "./vse_out/Debug/opt/CUDA/" && \ | |
| unzip -j cudnn.zip "*/bin/*" -d "./vse_out/Release/opt/CUDA/" && \ | |
| rm -fv cudnn.zip | |
| - name: 上传 Debug 文件夹到 Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vse-v${{ env.VERSION }}-windows-nvidia-cuda-10.2-debug | |
| path: vse_out/Debug/ | |
| - name: 上传 Release 文件夹到 Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vse-v${{ env.VERSION }}-windows-nvidia-cuda-10.2-release | |
| path: vse_out/Release/ | |
| - name: 打包 Release 文件夹 | |
| run: | | |
| cd vse_out/Release | |
| 7z a -t7z -mx=9 -m0=LZMA2 -ms=on -mfb=64 -md=32m -mmt=on -v1888m vse-v${{ env.VERSION }}-windows-nvidia-cuda-10.2.7z * && \ | |
| # 检测是否只有一个分卷 | |
| if [ -f vse-v${{ env.VERSION }}-windows-nvidia-cuda-10.2.7z.001 ] && [ ! -f vse-v${{ env.VERSION }}-windows-nvidia-cuda-10.2.7z.002 ]; then \ | |
| mv vse-v${{ env.VERSION }}-windows-nvidia-cuda-10.2.7z.001 vse-v${{ env.VERSION }}-windows-nvidia-cuda-10.2.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: | | |
| vse_out/Release/vse-v${{ env.VERSION }}-windows-nvidia-cuda-10.2.7z* |