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
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Get installer version
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 24
|
|
||||||
|
|
||||||
- name: Get latest dsh version
|
|
||||||
id: version
|
id: version
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
LATEST=$(npm view @deepseek-ai/dsh version)
|
ISS="/c/Users/VanuSystems-Mu/dsh-setup/setup-offline.iss"
|
||||||
echo "latest=$LATEST"
|
if [ ! -f "$ISS" ]; then
|
||||||
echo "latest=$LATEST" >> "$GITHUB_OUTPUT"
|
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
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir -p pkg/app/src
|
cd /c/Users/VanuSystems-Mu/dsh-setup
|
||||||
cp app/dsh-app.exe pkg/app/
|
"/c/Program Files (x86)/Inno Setup 6/ISCC.exe" /Qp setup-offline.iss || exit 1
|
||||||
cp app/Microsoft.Web.WebView2.Core.dll app/Microsoft.Web.WebView2.WinForms.dll app/WebView2Loader.dll pkg/app/
|
ls -la output/
|
||||||
cp app/src/dsh-app.cs app/src/app.manifest pkg/app/src/
|
cp output/DeepSeekHarness-Setup-Offline.exe "$GITHUB_WORKSPACE"/
|
||||||
cp dsh.ico README.md install.cmd uninstall.vbs register-uninstall.ps1 pkg/
|
echo "offline installer built: $(ls -la "$GITHUB_WORKSPACE/DeepSeekHarness-Setup-Offline.exe")"
|
||||||
cd pkg && python ../scripts/build-online.py ../dsh-desktop-online.zip
|
|
||||||
|
|
||||||
- name: Create or reuse release
|
- name: Create or reuse release
|
||||||
id: release
|
id: release
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
VER="${{ steps.version.outputs.latest }}"
|
VER="${{ steps.version.outputs.version }}"
|
||||||
TAG="v${VER}"
|
TAG="v${VER}"
|
||||||
API="https://git.vanusys.com/api/v1/repos/${{ github.repository }}"
|
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
|
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 "$EXIST" > release_id.txt
|
||||||
echo "reuse existing release $EXIST"
|
echo "reuse existing release $EXIST"
|
||||||
else
|
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 \
|
curl -s -X POST \
|
||||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
@@ -66,14 +65,9 @@ jobs:
|
|||||||
AUTH="Authorization: token ${{ secrets.GITHUB_TOKEN }}"
|
AUTH="Authorization: token ${{ secrets.GITHUB_TOKEN }}"
|
||||||
# remove same-name old assets first
|
# remove same-name old assets first
|
||||||
curl -s -H "$AUTH" "$API/releases/${ID}/assets" -o assets.json
|
curl -s -H "$AUTH" "$API/releases/${ID}/assets" -o assets.json
|
||||||
python -c "
|
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
|
||||||
import json
|
|
||||||
for a in json.load(open('assets.json')):
|
|
||||||
if a['name'] == 'dsh-desktop-online.zip':
|
|
||||||
print(a['id'])
|
|
||||||
" > old_ids.txt
|
|
||||||
while read AID; do
|
while read AID; do
|
||||||
curl -s -X DELETE -H "$AUTH" "$API/releases/${ID}/assets/${AID}" -o /dev/null
|
curl -s -X DELETE -H "$AUTH" "$API/releases/${ID}/assets/${AID}" -o /dev/null
|
||||||
echo "deleted old asset $AID"
|
echo "deleted old asset $AID"
|
||||||
done < old_ids.txt
|
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