From d268fa7dd5ca6bf185e9df9a235252c3895e56e7 Mon Sep 17 00:00:00 2001 From: katelya Date: Tue, 2 Sep 2025 15:16:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=92=8C=E6=96=87=E6=A1=A3=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20Docker=20=E9=95=9C=E5=83=8F=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E4=B8=BA=20katelya77/KatelyaTV?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/release.yml | 72 ++++----- .github/workflows/release.yml | 269 ++++++++-------------------------- .github/workflows/sync.yml | 2 +- README.md | 4 +- scripts/version-manager.js | 12 +- src/lib/version.ts | 6 +- 6 files changed, 109 insertions(+), 256 deletions(-) diff --git a/.github/release.yml b/.github/release.yml index 896a898..5819b58 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -9,41 +9,41 @@ tag-template: 'v$RESOLVED_VERSION' # 发布说明模板 body-template: | ## 🎉 新版本发布 - + **版本号**: $RESOLVED_VERSION **发布日期**: $RELEASE_DATE - + ### ✨ 新功能 $CHANGES - + ### 🐛 修复 $FIXES - + ### 🔧 改进 $IMPROVEMENTS - + ### 📝 文档更新 $DOCS - + ### 🚀 部署说明 - + #### Docker 部署 ```bash - docker pull ghcr.io/senshinya/moontv:v$RESOLVED_VERSION - docker run -d --name moontv -p 3000:3000 --env PASSWORD=your_password ghcr.io/senshinya/moontv:v$RESOLVED_VERSION + docker pull ghcr.io/katelya77/katelyatv:v$RESOLVED_VERSION + docker run -d --name katelyatv -p 3000:3000 --env PASSWORD=your_password ghcr.io/katelya77/katelyatv:v$RESOLVED_VERSION ``` - + #### 环境变量更新 请查看 [README.md](README.md) 了解最新的环境变量配置。 - + ### 📋 完整更新日志 查看 [CHANGELOG.md](CHANGELOG.md) 了解详细的更新历史。 - + ### 🔗 相关链接 - - [项目主页](https://github.com/senshinya/moontv) - - [在线演示](https://moontv.vercel.app) - - [问题反馈](https://github.com/senshinya/moontv/issues) - - [功能建议](https://github.com/senshinya/moontv/discussions) + - [项目主页](https://github.com/katelya77/KatelyaTV) + - [在线演示](https://katelyatv.vercel.app) + - [问题反馈](https://github.com/katelya77/KatelyaTV/issues) + - [功能建议](https://github.com/katelya77/KatelyaTV/discussions) # 发布配置 prerelease: false @@ -96,63 +96,63 @@ categories: # 模板配置 template: | ## 🎯 发布概述 - + 本次发布包含以下主要更新: - + ### ✨ 新功能 - 新增观看历史记录功能,支持断点续播 - 集成豆瓣热门推荐系统 - 支持 PWA 安装和离线缓存 - 新增多用户权限管理系统 - + ### 🐛 问题修复 - 修复播放进度记录丢失问题 - 优化视频播放器兼容性 - 修复移动端响应式布局问题 - + ### 🔧 性能优化 - 优化搜索接口响应速度 - 改进缓存策略,减少重复请求 - 优化数据库查询性能 - + ### 📱 用户体验 - 新增深色模式支持 - 优化移动端操作体验 - 改进错误提示和加载状态 - + ## 🚀 快速开始 - + 1. **Docker 部署**(推荐) ```bash - docker pull ghcr.io/senshinya/moontv:v$RESOLVED_VERSION - docker run -d --name moontv -p 3000:3000 --env PASSWORD=your_password ghcr.io/senshinya/moontv:v$RESOLVED_VERSION + docker pull ghcr.io/katelya77/katelyatv:v$RESOLVED_VERSION + docker run -d --name katelyatv -p 3000:3000 --env PASSWORD=your_password ghcr.io/katelya77/katelyatv:v$RESOLVED_VERSION ``` - + 2. **Vercel 部署** - Fork 本仓库 - 在 Vercel 中导入项目 - 设置环境变量 PASSWORD - 自动部署完成 - + 3. **Cloudflare Pages 部署** - Fork 本仓库 - 在 Cloudflare Pages 中导入项目 - 设置构建命令:`pnpm run pages:build` - 配置环境变量 - + ## 📋 环境变量 - + | 变量 | 说明 | 默认值 | |------|------|--------| | PASSWORD | 访问密码 | 必填 | | NEXT_PUBLIC_STORAGE_TYPE | 存储类型 | localstorage | | USERNAME | 管理员账号 | 空 | - + 更多环境变量请查看 [README.md](README.md) - + ## 🔗 相关资源 - - - [项目文档](https://github.com/senshinya/moontv#readme) - - [问题反馈](https://github.com/senshinya/moontv/issues) - - [功能讨论](https://github.com/senshinya/moontv/discussions) - - [贡献指南](https://github.com/senshinya/moontv/blob/main/CONTRIBUTING.md) \ No newline at end of file + + - [项目文档](https://github.com/katelya77/KatelyaTV#readme) + - [问题反馈](https://github.com/katelya77/KatelyaTV/issues) + - [功能讨论](https://github.com/katelya77/KatelyaTV/discussions) + - [贡献指南](https://github.com/katelya77/KatelyaTV/blob/main/CONTRIBUTING.md) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bca0836..57c9926 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,60 +13,44 @@ jobs: packages: write discussions: write issues: write - + steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 - token: ${{ secrets.GITHUB_TOKEN }} - + - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '18' - # 修改这里:改为 pnpm 或者移除 cache 配置 - # cache: 'npm' # 删除这行,因为使用的是 pnpm - + - name: Setup pnpm uses: pnpm/action-setup@v2 with: version: 8 - # 添加 pnpm 缓存配置 run_install: false - - - name: Get pnpm store directory - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - + - name: Setup pnpm cache uses: actions/cache@v3 with: - path: ${{ env.STORE_PATH }} + path: ~/.pnpm-store key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-pnpm-store- - + - name: Install dependencies run: pnpm install --frozen-lockfile - + - name: Build project run: pnpm run build - env: - PASSWORD: ${{ secrets.PASSWORD }} - + - name: Create Release uses: softprops/action-gh-release@v1 with: files: | - .next/**/* - public/**/* package.json - README.md - CHANGELOG.md - LICENSE - config.json + pnpm-lock.yaml next.config.js tailwind.config.ts tsconfig.json @@ -75,218 +59,87 @@ jobs: generate_release_notes: true draft: false prerelease: false - title: '🎉 Release ${{ github.ref_name }}' + tag_name: ${{ github.ref_name }} + name: '🎉 Release ${{ github.ref_name }}' body: | ## 🎉 新版本发布 - + **版本号**: ${{ github.ref_name }} **发布日期**: ${{ github.event.head_commit.timestamp }} - + ### 🚀 快速开始 - + #### Docker 部署(推荐) ```bash - docker pull ghcr.io/senshinya/moontv:${{ github.ref_name }} - docker run -d --name moontv -p 3000:3000 --env PASSWORD=your_password ghcr.io/senshinya/moontv:${{ github.ref_name }} + docker pull ghcr.io/katelya77/katelyatv:${{ github.ref_name }} + docker run -d --name katelyatv -p 3000:3000 --env PASSWORD=your_password ghcr.io/katelya77/katelyatv:${{ github.ref_name }} ``` - - #### Vercel 部署 - - Fork 本仓库 - - 在 Vercel 中导入项目 - - 设置环境变量 PASSWORD - - 自动部署完成 - + #### Cloudflare Pages 部署 - Fork 本仓库 - 在 Cloudflare Pages 中导入项目 - - 设置构建命令:`pnpm run pages:build` - - 配置环境变量 - + - 构建命令:`pnpm pages:build` + - 输出目录:`.vercel/output/static` + + #### Vercel 部署 + - Fork 本仓库 + - 在 Vercel 中导入项目 + - 构建命令:`pnpm run build` + ### 📋 环境变量 - + | 变量 | 说明 | 默认值 | |------|------|--------| | PASSWORD | 访问密码 | 必填 | | NEXT_PUBLIC_STORAGE_TYPE | 存储类型 | localstorage | | USERNAME | 管理员账号 | 空 | - + 更多环境变量请查看 [README.md](README.md) - + ### 🔗 相关资源 - - - [项目文档](https://github.com/senshinya/moontv#readme) - - [问题反馈](https://github.com/senshinya/moontv/issues) - - [功能讨论](https://github.com/senshinya/moontv/discussions) - - [贡献指南](https://github.com/senshinya/moontv/blob/main/CONTRIBUTING.md) - + + - [项目文档](https://github.com/katelya77/KatelyaTV#readme) + - [问题反馈](https://github.com/katelya77/KatelyaTV/issues) + - [功能讨论](https://github.com/katelya77/KatelyaTV/discussions) + - [贡献指南](https://github.com/katelya77/KatelyaTV/blob/main/CONTRIBUTING.md) + ### 📝 更新日志 - + 查看 [CHANGELOG.md](CHANGELOG.md) 了解详细的更新历史。 - + --- - + **注意**: 本项目仅供学习和个人使用,请遵守当地法律法规。 - + + docker: + needs: release + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and Push Docker Image uses: docker/build-push-action@v5 with: context: . push: true tags: | - ghcr.io/senshinya/moontv:${{ github.ref_name }} - ghcr.io/senshinya/moontv:latest + ghcr.io/katelya77/katelyatv:${{ github.ref_name }} + ghcr.io/katelyatv/katelyatv:latest cache-from: type=gha cache-to: type=gha,mode=max platforms: linux/amd64,linux/arm64 - - - name: Update Release with Docker Info - uses: softprops/action-gh-release@v1 - with: - body: | - ## 🎉 新版本发布 - - **版本号**: ${{ github.ref_name }} - **发布日期**: ${{ github.event.head_commit.timestamp }} - - ### 🐳 Docker 镜像 - - Docker 镜像已自动构建并推送到 GitHub Container Registry: - - ```bash - # 拉取指定版本 - docker pull ghcr.io/senshinya/moontv:${{ github.ref_name }} - - # 拉取最新版本 - docker pull ghcr.io/senshinya/moontv:latest - - # 运行容器 - docker run -d --name moontv -p 3000:3000 --env PASSWORD=your_password ghcr.io/senshinya/moontv:${{ github.ref_name }} - ``` - - ### 🚀 其他部署方式 - - #### Vercel 部署 - - Fork 本仓库 - - 在 Vercel 中导入项目 - - 设置环境变量 PASSWORD - - 自动部署完成 - - #### Cloudflare Pages 部署 - - Fork 本仓库 - - 在 Cloudflare Pages 中导入项目 - - 设置构建命令:`pnpm run pages:build` - - 配置环境变量 - - ### 📋 环境变量 - - | 变量 | 说明 | 默认值 | - |------|------|--------| - | PASSWORD | 访问密码 | 必填 | - | NEXT_PUBLIC_STORAGE_TYPE | 存储类型 | localstorage | - | USERNAME | 管理员账号 | 空 | - - 更多环境变量请查看 [README.md](README.md) - - ### 🔗 相关资源 - - - [项目文档](https://github.com/senshinya/moontv#readme) - - [问题反馈](https://github.com/senshinya/moontv/issues) - - [功能讨论](https://github.com/senshinya/moontv/discussions) - - [贡献指南](https://github.com/senshinya/moontv/blob/main/CONTRIBUTING.md) - - ### 📝 更新日志 - - 查看 [CHANGELOG.md](CHANGELOG.md) 了解详细的更新历史。 - - --- - - **注意**: 本项目仅供学习和个人使用,请遵守当地法律法规。 - update_existing_release: true - - - name: Create Discussion - uses: actions/github-script@v7 - with: - script: | - const { data: discussions } = await github.rest.discussions.create({ - owner: context.repo.owner, - repo: context.repo.repo, - title: `🎉 ${context.ref_name} 版本发布讨论`, - body: `## 🎉 ${context.ref_name} 版本发布成功! - - 新版本已成功发布,包含以下更新: - - ### 🚀 主要特性 - - 观看历史记录功能 - - 多源聚合搜索 - - PWA 支持 - - 深色模式 - - 多用户系统 - - ### 🐳 Docker 部署 - \`\`\`bash - docker pull ghcr.io/senshinya/moontv:${context.ref_name} - docker run -d --name moontv -p 3000:3000 --env PASSWORD=your_password ghcr.io/senshinya/moontv:${context.ref_name} - \`\`\` - - ### 📋 环境变量 - | 变量 | 说明 | 默认值 | - |------|------|--------| - | PASSWORD | 访问密码 | 必填 | - | NEXT_PUBLIC_STORAGE_TYPE | 存储类型 | localstorage | - | USERNAME | 管理员账号 | 空 | - - ### 🔗 相关链接 - - [Release 页面](https://github.com/${context.repo.owner}/${context.repo.repo}/releases/tag/${context.ref_name}) - - [项目文档](https://github.com/${context.repo.owner}/${context.repo.repo}#readme) - - [问题反馈](https://github.com/${context.repo.owner}/${context.repo.repo}/issues) - - --- - - 欢迎在此讨论新版本的使用体验、问题反馈和功能建议! - - **注意**: 本项目仅供学习和个人使用,请遵守当地法律法规。`, - category: 'ANNOUNCEMENT' - }); - - console.log(`Discussion created: ${discussions.html_url}`); - - - name: Comment on Issues - uses: actions/github-script@v7 - with: - script: | - // 查找与当前版本相关的 issue - const { data: issues } = await github.rest.issues.listForRepo({ - owner: context.repo.owner, - repo: context.repo.repo, - state: 'open', - labels: ['enhancement', 'bug', 'feature'] - }); - - // 在相关 issue 下添加评论 - for (const issue of issues) { - if (issue.title.toLowerCase().includes('release') || - issue.title.toLowerCase().includes('version') || - issue.body?.toLowerCase().includes('release') || - issue.body?.toLowerCase().includes('version')) { - - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: issue.number, - body: `🎉 好消息!${context.ref_name} 版本已经发布,可能解决了您提到的问题。 - - 请查看 [Release 页面](https://github.com/${context.repo.owner}/${context.repo.repo}/releases/tag/${context.ref_name}) 了解详细更新内容。 - - 如果问题仍然存在,请提供更多详细信息,我们会继续关注。` - }); - - console.log(`Commented on issue #${issue.number}`); - } - } - - - name: Notify Success - run: | - echo "🎉 Release ${{ github.ref_name }} 发布成功!" - echo "📦 Docker 镜像: ghcr.io/senshinya/moontv:${{ github.ref_name }}" - echo "🔗 Release 页面: https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }}" - echo "📝 更新日志: https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md" diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 193891f..b10b71f 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -25,7 +25,7 @@ jobs: id: sync uses: aormsby/Fork-Sync-With-Upstream-action@v3.4.1 with: - upstream_sync_repo: senshinya/MoonTV + upstream_sync_repo: katelya77/KatelyaTV upstream_sync_branch: main target_sync_branch: main target_repo_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index e4475d5..1819770 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,6 @@ - **🔐 隐私保护**:本地部署,数据完全掌控 - **🌍 国际化**:多语言支持(规划中) - ## 📋 技术栈 | 分类 | 主要依赖 | @@ -360,9 +359,10 @@ docker run --rm -v katelyatv-redis-data:/data -v $(pwd):/backup alpine tar xzf / 在构建设置页面填写: -- **构建命令**: `npm install && npm run pages:build` +- **构建命令**: `pnpm install && pnpm pages:build` - **构建输出目录**: `.vercel/output/static` - **Root directory**: `./`(默认) +- **Node.js 版本**: `18`(推荐) #### 第三步:设置兼容性 diff --git a/scripts/version-manager.js b/scripts/version-manager.js index 8ddd885..2f3047b 100644 --- a/scripts/version-manager.js +++ b/scripts/version-manager.js @@ -168,8 +168,8 @@ function updateChangelog(newVersion, type) { #### Docker 部署 \`\`\`bash -docker pull ghcr.io/senshinya/moontv:v${newVersion} -docker run -d --name moontv -p 3000:3000 --env PASSWORD=your_password ghcr.io/senshinya/moontv:v${newVersion} +docker pull ghcr.io/katelya77/katelyatv:v${newVersion} +docker run -d --name katelyatv -p 3000:3000 --env PASSWORD=your_password ghcr.io/katelya77/katelyatv:v${newVersion} \`\`\` #### 环境变量更新 @@ -179,10 +179,10 @@ docker run -d --name moontv -p 3000:3000 --env PASSWORD=your_password ghcr.io/se 查看 [CHANGELOG.md](CHANGELOG.md) 了解详细的更新历史。 ### 🔗 相关链接 -- [项目主页](https://github.com/senshinya/moontv) -- [在线演示](https://moontv.vercel.app) -- [问题反馈](https://github.com/senshinya/moontv/issues) -- [功能建议](https://github.com/senshinya/moontv/discussions) +- [项目主页](https://github.com/katelya77/KatelyaTV) +- [在线演示](https://katelyatv.vercel.app) +- [问题反馈](https://github.com/katelya77/KatelyaTV/issues) +- [功能建议](https://github.com/katelya77/KatelyaTV/discussions) `; diff --git a/src/lib/version.ts b/src/lib/version.ts index 0f8353c..02d61a7 100644 --- a/src/lib/version.ts +++ b/src/lib/version.ts @@ -11,14 +11,14 @@ export enum UpdateStatus { FETCH_FAILED = 'fetch_failed', // 获取失败 } -// 远程版本检查URL配置(支持环境变量覆盖,并保留 MoonTV 上游作为后备) +// 远程版本检查URL配置(支持环境变量覆盖) const ENV_PRIMARY = process.env.NEXT_PUBLIC_VERSION_URL_PRIMARY; const ENV_BACKUP = process.env.NEXT_PUBLIC_VERSION_URL_BACKUP; const VERSION_CHECK_URLS = [ ENV_PRIMARY, ENV_BACKUP, - 'https://ghfast.top/raw.githubusercontent.com/senshinya/MoonTV/main/VERSION.txt', - 'https://raw.githubusercontent.com/senshinya/MoonTV/main/VERSION.txt', + 'https://ghfast.top/raw.githubusercontent.com/katelya77/KatelyaTV/main/VERSION.txt', + 'https://raw.githubusercontent.com/katelya77/KatelyaTV/main/VERSION.txt', ].filter(Boolean) as string[]; /**