From 919b65eb3c192a0ca0c7b92a089cbdca5d878ee8 Mon Sep 17 00:00:00 2001 From: Reasonix Date: Fri, 14 Aug 2026 18:16:38 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20workflow=20=E6=94=B9=E4=B8=BA=E4=BB=85?= =?UTF-8?q?=E6=9E=84=E5=BB=BA/=E5=8F=91=E5=B8=83=20Offline=20=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E5=99=A8=EF=BC=88=E6=9C=AC=E6=9C=BA=20dsh-setup=20?= =?UTF-8?q?=E7=9B=B4=E8=BF=9E=E6=9E=84=E5=BB=BA=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/auto-release.yml | 44 +++++++++++++------------------ 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/.gitea/workflows/auto-release.yml b/.gitea/workflows/auto-release.yml index 32018a5..7b5818f 100644 --- a/.gitea/workflows/auto-release.yml +++ b/.gitea/workflows/auto-release.yml @@ -12,34 +12,33 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: 24 - - - name: Get latest dsh version + - name: Get installer version id: version shell: bash run: | - LATEST=$(npm view @deepseek-ai/dsh version) - echo "latest=$LATEST" - echo "latest=$LATEST" >> "$GITHUB_OUTPUT" + ISS="/c/Users/VanuSystems-Mu/dsh-setup/setup-offline.iss" + if [ ! -f "$ISS" ]; then + echo "::error::本机构建源缺失: $ISS(Offline 构建需要先同步 dsh-setup 到短路径)" + exit 1 + fi + VER=$(sed -n 's/^#define MyAppVersion "\(.*\)"/\1/p' "$ISS") + echo "version=$VER" + echo "version=$VER" >> "$GITHUB_OUTPUT" - - name: Assemble online package + - name: Build offline installer (host machine) shell: bash 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 && python ../scripts/build-online.py ../dsh-desktop-online.zip + cd /c/Users/VanuSystems-Mu/dsh-setup + "/c/Program Files (x86)/Inno Setup 6/ISCC.exe" /Qp setup-offline.iss || exit 1 + ls -la output/ + cp output/DeepSeekHarness-Setup-Offline.exe "$GITHUB_WORKSPACE"/ + echo "offline installer built: $(ls -la "$GITHUB_WORKSPACE/DeepSeekHarness-Setup-Offline.exe")" - name: Create or reuse release id: release shell: bash run: | - VER="${{ steps.version.outputs.latest }}" + VER="${{ steps.version.outputs.version }}" TAG="v${VER}" API="https://git.vanusys.com/api/v1/repos/${{ github.repository }}" curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "$API/releases/tags/${TAG}" -o exist.json @@ -48,7 +47,7 @@ jobs: echo "$EXIST" > release_id.txt echo "reuse existing release $EXIST" else - BODY="Auto-built by Gitea Actions. dsh version: ${VER}. Online install package (run install.cmd, requires network)." + BODY="Auto-built by Gitea Actions. Offline installer (bundled Node.js + dsh runtime). Installer version: ${VER}." curl -s -X POST \ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Content-Type: application/json" \ @@ -66,14 +65,9 @@ jobs: AUTH="Authorization: token ${{ secrets.GITHUB_TOKEN }}" # remove same-name old assets first curl -s -H "$AUTH" "$API/releases/${ID}/assets" -o assets.json - python -c " -import json -for a in json.load(open('assets.json')): - if a['name'] == 'dsh-desktop-online.zip': - print(a['id']) -" > old_ids.txt + python -c "import json; [print(a['id']) for a in json.load(open('assets.json')) if a['name'] == 'DeepSeekHarness-Setup-Offline.exe']" > old_ids.txt while read AID; do curl -s -X DELETE -H "$AUTH" "$API/releases/${ID}/assets/${AID}" -o /dev/null echo "deleted old asset $AID" done < old_ids.txt - curl -s -X POST -H "$AUTH" -F "attachment=@dsh-desktop-online.zip" "$API/releases/${ID}/assets" + curl -s -X POST -H "$AUTH" -F "attachment=@$GITHUB_WORKSPACE/DeepSeekHarness-Setup-Offline.exe" "$API/releases/${ID}/assets"