ci: 优化 Gitea Actions Workflow 配置
- 添加 GITEA_TOKEN 全局变量 - 使用 dtolnay/rust-action 编译 - 安装必要依赖 - 使用 ncipollo/release-action 上传 - 修复上传问题
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user