ci: Gitea Actions 定时自动打包发布 + 安装包支持卸载注册
- .gitea/workflows/auto-release.yml:每周一 cron + 手动触发,自动检查 dsh 最新版、 打包 online 安装包、创建 Release 并上传附件(push 触发为临时验证用) - install.cmd 加入仓库:安装时注册 Windows 卸载项(配合 uninstall.vbs)
This commit is contained in:
1 parent
880915bf01
commit
4dcb8a29f5
2 files changed
+125
No files matched your search
@@ -0,0 +1,64 @@
|
||||
name: auto-release
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 3 * * 1' # 每周一 03:00 UTC
|
||||
workflow_dispatch: {} # 手动触发
|
||||
push:
|
||||
branches: [master] # 临时:用于验证 runner,验证后移除
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 24
|
||||
|
||||
- name: Get latest dsh version
|
||||
id: version
|
||||
run: |
|
||||
LATEST=$(npm view @deepseek-ai/dsh version)
|
||||
echo "latest=$LATEST"
|
||||
echo "latest=$LATEST" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Assemble online package
|
||||
run: |
|
||||
mkdir -p pkg/app/src
|
||||
cp app/dsh-app.exe pkg/app/
|
||||
cp app/Microsoft.Web.WebView2.Core.dll app/Microsoft.Web.WebView2.WinForms.dll app/WebView2Loader.dll pkg/app/
|
||||
cp app/src/dsh-app.cs app/src/app.manifest pkg/app/src/
|
||||
cp dsh.ico README.md install.cmd uninstall.vbs register-uninstall.ps1 pkg/
|
||||
cd pkg && python3 - <<'PY'
|
||||
import zipfile, os
|
||||
with zipfile.ZipFile('../dsh-desktop-online.zip', 'w', zipfile.ZIP_DEFLATED) as z:
|
||||
for r, _, fs in os.walk('.'):
|
||||
for f in fs:
|
||||
p = os.path.join(r, f)
|
||||
z.write(p, os.path.relpath(p, '.'))
|
||||
PY
|
||||
|
||||
- name: Create release
|
||||
id: release
|
||||
run: |
|
||||
VER="${{ steps.version.outputs.latest }}"
|
||||
BODY="Auto-built by Gitea Actions. dsh version: ${VER}. Online install package (runs install.cmd, requires network)."
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\":\"v${VER}\",\"name\":\"DeepSeek Harness v${VER}\",\"body\":\"${BODY}\",\"draft\":false,\"prerelease\":false}" \
|
||||
"https://git.vanusys.com/api/v1/repos/${{ github.repository }}/releases" > release.json
|
||||
python3 -c "import json; print(json.load(open('release.json'))['id'])" > release_id.txt
|
||||
echo "release_id=$(cat release_id.txt)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Upload asset
|
||||
run: |
|
||||
ID="${{ steps.release.outputs.release_id }}"
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||
-F "attachment=@dsh-desktop-online.zip" \
|
||||
"https://git.vanusys.com/api/v1/repos/${{ github.repository }}/releases/${ID}/assets"
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
@echo off
|
||||
setlocal
|
||||
title DeepSeek Harness Installer (Online)
|
||||
|
||||
echo ============================================
|
||||
echo DeepSeek Harness Desktop - Online Install
|
||||
echo ============================================
|
||||
echo.
|
||||
|
||||
REM ---- 1. Node.js ----
|
||||
where node >nul 2>nul
|
||||
if %errorlevel%==0 (
|
||||
echo [1/5] Node.js detected
|
||||
goto node_ok
|
||||
)
|
||||
echo [1/5] Node.js not found, installing via winget...
|
||||
winget install --id OpenJS.NodeJS.LTS -e --accept-source-agreements --accept-package-agreements
|
||||
if %errorlevel% neq 0 (
|
||||
echo.
|
||||
echo [ERROR] Node.js install failed. Please install manually from https://nodejs.org (LTS), then run this script again.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
set "PATH=%PATH%;C:\Program Files\nodejs;%APPDATA%\npm"
|
||||
:node_ok
|
||||
|
||||
REM ---- 2. npm registry (mirror for speed) ----
|
||||
echo [2/5] Setting npm mirror registry...
|
||||
call npm config set registry https://registry.npmmirror.com
|
||||
|
||||
REM ---- 3. Install dsh ----
|
||||
echo [3/5] Installing DeepSeek Harness (dsh)...
|
||||
call npm install -g @deepseek-ai/dsh
|
||||
if %errorlevel% neq 0 (
|
||||
echo.
|
||||
echo [ERROR] dsh install failed. Check network and retry.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
REM ---- 4. Deploy app ----
|
||||
echo [4/5] Deploying application...
|
||||
set "DEST=%LOCALAPPDATA%\DeepSeekHarness"
|
||||
if not exist "%DEST%" mkdir "%DEST%"
|
||||
xcopy /E /I /Y app "%DEST%\app" >nul
|
||||
copy /Y dsh.ico "%DEST%\" >nul
|
||||
copy /Y README.md "%DEST%\" >nul
|
||||
|
||||
REM ---- 5. Register uninstall (Apps & Features) ----
|
||||
echo [5/5] Registering uninstall entry...
|
||||
copy /Y uninstall.vbs "%DEST%\" >nul
|
||||
copy /Y register-uninstall.ps1 "%DEST%\" >nul
|
||||
powershell -NoProfile -ExecutionPolicy Bypass -File "%DEST%\register-uninstall.ps1"
|
||||
|
||||
REM ---- 6. Desktop shortcut ----
|
||||
powershell -NoProfile -ExecutionPolicy Bypass -Command "$s=(New-Object -ComObject WScript.Shell).CreateShortcut([Environment]::GetFolderPath('Desktop')+'\DeepSeek Harness.lnk');$s.TargetPath='%DEST%\app\dsh-app.exe';$s.IconLocation='%DEST%\dsh.ico,0';$s.WorkingDirectory='%DEST%\app';$s.Save()"
|
||||
|
||||
echo.
|
||||
echo Install complete! Launching...
|
||||
start "" "%DEST%\app\dsh-app.exe"
|
||||
pause
|
||||
Reference in new issue
Block a user