Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持CI自动发布新版本 #379

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions .github/workflows/build-windows-cpu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Build Windows CPU

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==3.0.0rc1
- 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 && \
rm -fv ./vse_out/*/opt/packages/numpy-2*
env:
QPT_Action: "True"
shell: bash
- name: 上传 Debug 文件夹到 Artifacts
uses: actions/upload-artifact@v4
with:
name: vse-v${{ env.VERSION }}-windows-cpu-debug
path: vse_out/Debug/
- name: 上传 Release 文件夹到 Artifacts
uses: actions/upload-artifact@v4
with:
name: vse-v${{ env.VERSION }}-windows-cpu-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-cpu.7z * && \
# 检测是否只有一个分卷
if [ -f vse-v${{ env.VERSION }}-windows-cpu.7z.001 ] && [ ! -f vse-v${{ env.VERSION }}-windows-cpu.7z.002 ]; then \
mv vse-v${{ env.VERSION }}-windows-cpu.7z.001 vse-v${{ env.VERSION }}-windows-cpu.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-cpu.7z*

114 changes: 114 additions & 0 deletions .github/workflows/build-windows-cuda-10.2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
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: 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 --cuda=10.2 && \
mv ../vse_out ./vse_out && \
git checkout requirements.txt && \
pip download -d ./vse_out/Debug/opt/packages/ paddlepaddle-gpu==2.5.2.post102 -f https://www.paddlepaddle.org.cn/whl/windows/mkl/avx/stable.html && \
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*
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: 硬字幕提取器 ${{ env.VERSION }}
files: |
vse_out/Release/vse-v${{ env.VERSION }}-windows-nvidia-cuda-10.2.7z*
95 changes: 95 additions & 0 deletions .github/workflows/build-windows-cuda-11.8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
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*
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*
Loading