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) - 重大变更
  • 当前版本 - 强制使用
  • 自定义版本

完整发布流程:

  1. 类型检查和测试
  2. 构建 Web + DWEB
  3. 上传到正式服务器
  4. 更新版本文件和 CHANGELOG
  5. 创建 git tag 并推送

6. 路径重命名

  • webapp-betawebapp-dev

环境变量

# .env.local
DWEB_SFTP_USER="keyapp"
DWEB_SFTP_PASS="xxx"
DWEB_SFTP_USER_DEV="keyapp-dev"
DWEB_SFTP_PASS_DEV="xxx"

GitHub Secrets 需要配置

  • DWEB_SFTP_USER
  • DWEB_SFTP_PASS
  • DWEB_SFTP_USER_DEV
  • DWEB_SFTP_PASS_DEV

Gaubee added 6 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
@Gaubee Gaubee closed this Jan 4, 2026
@Gaubee Gaubee deleted the feat/dweb-upload branch January 4, 2026 07:22
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