Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ jobs:
fi
cp release/bfmpay-dweb-beta.zip "release/bfmpay-dweb-${VERSION}-beta.zip"
fi

# Copy metadata.json for dweb://install link
if [ -f "dists/metadata.json" ]; then
cp dists/metadata.json release/metadata.json
fi

# 上传 DWEB 到 SFTP 服务器
- name: Upload DWEB to SFTP
Expand Down Expand Up @@ -234,7 +239,7 @@ jobs:
### DWEB 安装
在 DWEB 浏览器中打开以下链接安装:
```
dweb://install?url=https://github.com/${{ github.repository }}/releases/download/${{ steps.channel.outputs.channel == 'stable' && format('v{0}', steps.version.outputs.version) || 'beta' }}/bfmpay-dweb${{ steps.channel.outputs.channel == 'beta' && '-beta' || '' }}.zip
dweb://install?url=https://github.com/${{ github.repository }}/releases/download/${{ steps.channel.outputs.channel == 'stable' && format('v{0}', steps.version.outputs.version) || 'beta' }}/metadata.json
```

# ==================== GitHub-hosted 标准构建 ====================
Expand Down Expand Up @@ -442,6 +447,11 @@ jobs:
cp release/bfmpay-dweb-beta.zip "release/bfmpay-dweb-${VERSION}-beta.zip"
fi

# Copy metadata.json for dweb://install link
if [ -f "dists/metadata.json" ]; then
cp dists/metadata.json release/metadata.json
fi

echo "=== Release artifacts ==="
ls -la release/

Expand Down Expand Up @@ -530,5 +540,5 @@ jobs:
### DWEB 安装
在 DWEB 浏览器中打开以下链接安装:
```
dweb://install?url=https://github.com/${{ github.repository }}/releases/download/${{ needs.build-standard.outputs.channel == 'stable' && format('v{0}', needs.build-standard.outputs.version) || 'beta' }}/bfmpay-dweb${{ needs.build-standard.outputs.channel == 'beta' && '-beta' || '' }}.zip
dweb://install?url=https://github.com/${{ github.repository }}/releases/download/${{ needs.build-standard.outputs.channel == 'stable' && format('v{0}', needs.build-standard.outputs.version) || 'beta' }}/metadata.json
```
4 changes: 2 additions & 2 deletions docs/download.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<h3>DWEB 稳定版</h3>
</div>
<p>经过充分测试的稳定版本,推荐日常使用。</p>
<a href="dweb://install?url=https://github.com/BioforestChain/KeyApp/releases/latest/download/bfmpay-dweb.zip" class="download-btn">安装到 DWEB</a>
<a href="dweb://install?url=https://github.com/BioforestChain/KeyApp/releases/latest/download/metadata.json" class="download-btn">安装到 DWEB</a>
<a href="https://github.com/BioforestChain/KeyApp/releases/latest/download/bfmpay-dweb.zip" class="download-link">下载 ZIP 文件</a>
</div>

Expand All @@ -51,7 +51,7 @@
<h3>DWEB 测试版</h3>
</div>
<p>包含最新功能,每次代码更新自动发布。</p>
<a href="dweb://install?url=https://github.com/BioforestChain/KeyApp/releases/download/beta/bfmpay-dweb-beta.zip" class="download-btn secondary">安装 Beta 版</a>
<a href="dweb://install?url=https://github.com/BioforestChain/KeyApp/releases/download/beta/metadata.json" class="download-btn secondary">安装 Beta 版</a>
<a href="https://github.com/BioforestChain/KeyApp/releases/download/beta/bfmpay-dweb-beta.zip" class="download-link">下载 ZIP 文件</a>
</div>
</div>
Expand Down
9 changes: 9 additions & 0 deletions scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,15 @@ async function createReleaseArtifacts(webDir: string, dwebDir: string) {
const dwebVersionZipPath = join(releaseDir, `bfmpay-dweb-${version}${suffix}.zip`)
cpSync(dwebZipPath, dwebVersionZipPath)

// 复制 metadata.json 到 release 目录(plaoc bundle 自动生成)
const metadataSrc = join(DISTS_DIR, 'metadata.json')
if (existsSync(metadataSrc)) {
cpSync(metadataSrc, join(releaseDir, 'metadata.json'))
log.info(` - metadata.json`)
} else {
log.warn('metadata.json 未找到,dweb://install 链接可能无法正常工作')
}

log.success(`Release 产物创建完成: ${releaseDir}`)
log.info(` - ${webZipName}`)
log.info(` - ${dwebZipName}`)
Expand Down
Loading