From 7cc5e141c79234d37d54777bad2188d78b6891f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E9=BA=A6?= Date: Tue, 10 Mar 2026 16:46:41 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E4=BC=98=E5=8C=96=20Gitea=20Actions=20Wo?= =?UTF-8?q?rkflow=20=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 GITEA_TOKEN 全局变量 - 使用 dtolnay/rust-action 编译 - 安装必要依赖 - 使用 ncipollo/release-action 上传 - 修复上传问题 --- .gitea/workflows/release.yml | 44 ++++++++++++------------------------ 1 file changed, 15 insertions(+), 29 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 5ee3fa2..9672bfd 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -9,6 +9,7 @@ on: env: CARGO_TERM_COLOR: always RUST_BACKTRACE: 1 + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} jobs: build-windows: @@ -20,14 +21,16 @@ jobs: uses: actions/checkout@v4 - name: Setup Rust toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-action@stable with: - target: x86_64-pc-windows-gnu - profile: minimal - components: rustfmt, clippy - + targets: x86_64-pc-windows-gnu + - name: Install MinGW - run: sudo apt-get update && sudo apt-get install -y mingw-w64 + run: sudo apt-get update && sudo apt-get install -y mingw-w64 libssl-dev pkg-config + + - name: Install dependencies + run: | + sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev - name: Cache cargo registry uses: actions/cache@v4 @@ -42,38 +45,21 @@ jobs: run: | mkdir -p release cp target/x86_64-pc-windows-gnu/release/readflow.exe release/ - # Create README cat > release/README.txt << 'EOF' - ReadFlow v${{ github.ref_name }} for Windows - - 快速开始: + ReadFlow for Windows 1. 解压到任意目录 2. 双击运行 readflow.exe - - 功能: - - EPUB/MOBI/Markdown/PDF 阅读 - - 20+ 编程语言语法高亮 - - 双语翻译对照 - - 笔记与书签系统 - - 插件系统 - - 主题商店 - - 技术支持:damai@foshanhuiya.com EOF cd release - zip -r ../readflow-${{ github.ref_name }}-windows-x86_64.zip . + zip -r ../readflow-windows-x86_64.zip . - name: Upload to Release - uses: softprops/action-gh-release@v2 + uses: ncipollo/release-action@v1 with: - name: Windows x86_64 - files: readflow-${{ github.ref_name }}-windows-x86_64.zip - tag_name: ${{ github.ref_name }} + artifacts: "readflow-windows-x86_64.zip" + tag: ${{ github.ref_name }} token: ${{ secrets.GITEA_TOKEN }} - fail_on_unmatched_files: true - env: - GITHUB_SERVER_URL: http://192.168.120.110:4000 - GITHUB_REPOSITORY: damai/readflow + allowUpdates: true build-linux: name: Build Linux