diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5f108e0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,167 @@ +name: Release + +on: + # 新发布触发 + release: + types: [ published ] + + # 手动触发 + workflow_dispatch: + inputs: + tag: + description: 'Release tag (e.g., v1.0.0)' + required: true + type: string + +env: + CARGO_TERM_COLOR: always + NODE_VERSION: '18' + RUST_VERSION: '1.85.0' + PNPM_VERSION: '8' + +jobs: + # 构建发布版本 + build-release: + name: Build Release + runs-on: ${{ matrix.platform }} + + strategy: + fail-fast: false + matrix: + platform: [ macos-latest, windows-latest ] + include: + - platform: macos-latest + os: macos + target: universal-apple-darwin + - platform: windows-latest + os: windows + target: x86_64-pc-windows-msvc + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: ${{ env.PNPM_VERSION }} + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.RUST_VERSION }} + + - name: Add Rust targets (macOS) + if: matrix.platform == 'macos-latest' + run: | + rustup target add aarch64-apple-darwin + rustup target add x86_64-apple-darwin + + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + with: + workspaces: src-tauri + + - name: Install frontend dependencies + run: | + if [ -f "pnpm-lock.yaml" ]; then + pnpm install --frozen-lockfile + else + pnpm install + fi + shell: bash + + - name: Build application + run: pnpm tauri build --target ${{ matrix.target }} + + - name: List build output (debug) + run: | + echo "=== Build output structure ===" + find src-tauri/target -name "*.dmg" -o -name "*.app" -o -name "*.msi" -o -name "*.exe" | grep -E "\.(dmg|app|msi)$|CodeForge.*\.exe$" | head -20 + echo "=== Target directories ===" + ls -la src-tauri/target/ || echo "Target directory not found" + echo "=== Bundle directories ===" + find src-tauri/target -name "bundle" -type d | head -10 + shell: bash + + - name: Upload build artifacts (macOS) + if: matrix.platform == 'macos-latest' + uses: actions/upload-artifact@v4 + with: + name: release-${{ matrix.os }} + path: | + src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg + src-tauri/target/universal-apple-darwin/release/bundle/macos/*.app + retention-days: 30 + + - name: Upload build artifacts (Windows) + if: matrix.platform == 'windows-latest' + uses: actions/upload-artifact@v4 + with: + name: release-${{ matrix.os }} + path: | + src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/*.msi + src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.exe + retention-days: 30 + + # 创建或更新 GitHub Release + create-release: + name: Create Release + needs: build-release + runs-on: ubuntu-latest + if: github.event_name == 'workflow_dispatch' + + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Prepare release assets + run: | + mkdir -p release-assets + find artifacts -name "*.dmg" -exec cp {} release-assets/ \; + find artifacts -name "*.msi" -exec cp {} release-assets/ \; + find artifacts -name "*.exe" -exec cp {} release-assets/ \; + + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ github.event.inputs.tag }} + name: Release ${{ github.event.inputs.tag }} + files: release-assets/* + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + + # 更新现有 Release + update-release: + name: Update Release + needs: build-release + runs-on: ubuntu-latest + if: github.event_name == 'release' + + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Prepare release assets + run: | + mkdir -p release-assets + find artifacts -name "*.dmg" -exec cp {} release-assets/ \; + find artifacts -name "*.msi" -exec cp {} release-assets/ \; + find artifacts -name "*.exe" -exec cp {} release-assets/ \; + + - name: Upload to existing release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ github.event.release.tag_name }} + files: release-assets/* + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/docs/content/release/25.0.0.md b/docs/content/release/25.0.0.md new file mode 100644 index 0000000..b837e3f --- /dev/null +++ b/docs/content/release/25.0.0.md @@ -0,0 +1,73 @@ +--- +title: 25.0.0 +--- + +我们激动地宣布 **CodeForge v25.0.0** 正式发布!这是 CodeForge 项目的首个正式版本,标志着这款轻量级、高性能桌面代码执行器正式与大家见面。 + +CodeForge 专为开发者、学生和编程爱好者设计,致力于提供简洁高效的代码执行体验。 + +--- + +## 📦 项目信息 + +- **项目地址**:https://github.com/devlive-community/codeforge +- **官方网站**:https://codeforge.devlive.org/ +- **版本号**:v25.0.0 +- **发布日期**:2025年8月11日 + +--- + +## ✨ 核心功能特性 + +### 🔧 核心执行引擎 +- **多语言支持**:内置 Python2/Python3 支持,插件化架构可扩展更多语言 +- **实时代码执行**:支持代码实时运行和输出显示 +- **执行控制**:支持代码执行中断和超时控制 +- **结果复制**:一键复制执行结果到剪贴板 + +### 🎨 用户界面 +- **现代化编辑器**:集成代码高亮功能,提升编码体验 +- **组件化设计**:模块化的 UI 组件,包括 Tabs、Modal、Button、Toast、Select 等 +- **语言切换**:直观的语言选择界面,支持语言 Logo 显示 +- **关于页面**:完整的应用信息展示 + +### ⚙️ 系统配置 +- **插件系统**:支持插件定制配置和排序 +- **日志管理**:分级日志记录,支持独立文件存储 +- **配置更新**:支持语言配置动态更新 +- **执行环境**:自定义执行目录和编译前命令 + +### 🛠️ 开发体验 +- **快捷键支持**:完整的编辑器快捷键支持 +- **右键菜单**:优化的上下文菜单体验 +- **错误处理**:完善的错误提示和异常处理机制 + +--- + +## 🔄 技术架构 + +- **跨平台支持**:基于 Rust + Tauri 构建,支持 Windows、macOS +- **模块化设计**:核心功能拆分为独立模块,便于维护和扩展 +- **插件架构**:支持第三方语言插件开发 +- **现代化工具链**:使用最新的 Rust 1.85.0 和现代前端技术栈 + +--- + +## 🎯 适用场景 + +- **学习编程**:学生练习代码、验证算法逻辑 +- **快速验证**:开发者测试代码片段、调试问题 +- **教学演示**:教师课堂代码演示和讲解 +- **原型开发**:快速构建和测试代码原型 + +--- + +## 📥 立即体验 + +访问我们的 [GitHub 仓库](https://github.com/devlive-community/codeforge) 下载最新版本,或访问 [官方网站](https://codeforge.devlive.org/) 了解更多信息。 + +--- + +## 🤝 参与贡献 + +CodeForge 是一个开源项目,我们欢迎社区的贡献!无论是代码提交、Bug 反馈还是功能建议,都将帮助 CodeForge 变得更加完善。 diff --git a/docs/pageforge.yaml b/docs/pageforge.yaml index 36fdd82..38e8d8d 100644 --- a/docs/pageforge.yaml +++ b/docs/pageforge.yaml @@ -19,3 +19,7 @@ footer: github: title: GitHub href: https://github.com/devlive-community/codeforge + +nav: + - 发布日志: + - /release/25.0.0.md \ No newline at end of file