Update README_en.md #5
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 11.8 | |
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.12' | |
cache: 'pip' # caching pip dependencies | |
- run: pip install paddlepaddle-gpu==3.0.0rc1 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/ | |
- run: pip install -r requirements.txt | |
- run: pip freeze > requirements.txt | |
- 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 && \ | |
mv ../vse_out ./vse_out && \ | |
git checkout requirements.txt && \ | |
pip download -d ./vse_out/Debug/opt/packages/ paddlepaddle-gpu==3.0.0rc1 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/ && \ | |
pip download -d ./vse_out/Debug/opt/packages/ -r requirements.txt && \ | |
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" | |
shell: bash | |
- name: 上传 Debug 文件夹到 Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: vse-v${{ env.VERSION }}-windows-nvidia-cuda-11.8-debug | |
path: vse_out/Debug/ | |
- name: 上传 Release 文件夹到 Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: vse-v${{ env.VERSION }}-windows-nvidia-cuda-11.8-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-11.8.7z * && \ | |
# 检测是否只有一个分卷 | |
if [ -f vse-v${{ env.VERSION }}-windows-nvidia-cuda-11.8.7z.001 ] && [ ! -f vse-v${{ env.VERSION }}-windows-nvidia-cuda-11.8.7z.002 ]; then \ | |
mv vse-v${{ env.VERSION }}-windows-nvidia-cuda-11.8.7z.001 vse-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: 硬字幕提取器 ${{ env.VERSION }} | |
files: | | |
vse_out/Release/vse-v${{ env.VERSION }}-windows-nvidia-cuda-11.8.7z* |