Files
dsh-desktop/.gitea/workflows/auto-release.yml
T
Workflow config file is invalid. Please check your config file: go-yaml load error in scanner (while scanning a simple key) at L39.C1-L40.C1: could not find expected ':'

69 lines
2.5 KiB
YAML

name: auto-release
on:
schedule:
- cron: '0 3 * * 1' # 每周一 03:00 UTC
workflow_dispatch: {} # 手动触发
push:
branches: [master] # 临时:用于验证 runner,验证后移除
jobs:
build:
runs-on: windows-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
shell: bash
run: |
LATEST=$(npm view @deepseek-ai/dsh version)
echo "latest=$LATEST"
echo "latest=$LATEST" >> "$GITHUB_OUTPUT"
- name: Assemble online package
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 - <<'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
shell: bash
run: |
VER="${{ steps.version.outputs.latest }}"
BODY="Auto-built by Gitea Actions. dsh version: ${VER}. Online install package (run 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
python -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
shell: bash
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"