ci: workflow 改为仅构建/发布 Offline 安装器(本机 dsh-setup 直连构建)
This commit is contained in:
1 parent
5c042a2cf1
commit
919b65eb3c
1 file changed
+19
-25
@@ -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"
|
||||
Reference in new issue
Block a user