Skip to content

Conversation

@Gaubee
Copy link
Contributor

@Gaubee Gaubee commented Jan 4, 2026

功能概述

1. DWEB 打包和上传

  • 添加 SFTP 上传工具 (scripts/utils/sftp.ts)
  • 支持 --upload 参数上传到服务器
  • 默认 SFTP 服务器: sftp://iweb.xin:22022

2. Dev/Stable 渠道区分

渠道 账号变量 包名前缀 上传目录
dev (beta) DWEB_SFTP_USER_DEV dev. /YYMMDD/
stable DWEB_SFTP_USER /

3. Dev 版本自动编号

  • 格式: VERSION-dev.YYMMDDNO
  • 示例: 0.1.0-dev.26010401
  • 自动检测当天已有版本并累加

4. Dev 水印

  • 添加 DevWatermark 组件
  • 右上角红色 "DEV" 角标
  • 通过 __DEV_MODE__ 全局变量控制

5. 发布脚本 (pnpm release)

交互式版本选择:

  • Patch (0.0.x) - Bug 修复
  • Minor (0.x.0) - 新功能
  • Major (x.0.0) - 重大变更
  • 当前版本 - 强制使用
  • 自定义版本

6. 配置管理 (pnpm set-secret)

交互式配置工具,支持:

  • E2E 测试账号配置
  • DWEB 正式版发布账号
  • DWEB 开发版发布账号
  • 同时配置本地 + GitHub Secrets

7. 路径重命名

  • webapp-betawebapp-dev

使用方式

# 配置 secrets(交互式)
pnpm set-secret

# 查看配置状态
pnpm set-secret --list

# 发布正式版(交互式)
pnpm release

# 构建并上传开发版
bun scripts/build.ts dweb --upload

# 构建并上传正式版
bun scripts/build.ts dweb --upload --stable

Gaubee added 7 commits January 4, 2026 14:59
- Add ssh2-sftp-client dependency
- Create scripts/utils/sftp.ts with upload functionality
- Implement uploadDweb() in build.ts with retry mechanism
- Default SFTP URL: sftp://iweb.xin:22022
- Support DWEB_SFTP_USER, DWEB_SFTP_PASS env vars

Tested: Successfully uploaded to iweb.xin:22022
- beta channel uses DWEB_SFTP_USER_DEV / DWEB_SFTP_PASS_DEV
- stable channel uses DWEB_SFTP_USER / DWEB_SFTP_PASS
- Add SFTP upload step to both self-hosted and github-hosted CD workflows
- Add bun setup step for github-hosted runner
- Add auto dev version numbering: VERSION-dev.YYMMDDNO (e.g., 0.1.0-dev.26010401)
- Add dev prefix to dweb package id (dev.bfmpay.bfmeta.com.dweb)
- Upload dev builds to date-based directories (/YYMMDD/)
- Add DevWatermark component for dev builds
- Add VITE_DEV_MODE environment variable and __DEV_MODE__ global

Tested: Successfully built and uploaded dev.bfmpay.bfmeta.com.dweb-0.1.0-dev.26010401
- Add pnpm release command for version selection
- Support patch/minor/major/current/custom version
- Integrate build, upload, and GitHub Pages deployment
- Auto-update package.json, manifest.json, and CHANGELOG.md
- Create git tag and push to trigger CD
- Update all references from webapp-beta to webapp-dev
- Affects: CD workflow, build scripts, docs, gitignore
- Support multiple configuration categories:
  - E2E testing (mnemonic, address, second secret)
  - DWEB stable release (SFTP credentials)
  - DWEB dev release (SFTP credentials)
- Interactive category selection with checkbox
- Choose target: local only, GitHub only, or both
- Show configuration status with --list flag
- Auto-derive address from mnemonic
@Gaubee Gaubee merged commit 6ef23f7 into main Jan 4, 2026
5 checks passed
@Gaubee Gaubee deleted the feat/dweb-upload branch January 4, 2026 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants