ci: 优化 Gitea Actions Workflow 配置
- 添加 GITEA_TOKEN 全局变量 - 使用 dtolnay/rust-action 编译 - 安装必要依赖 - 使用 ncipollo/release-action 上传 - 修复上传问题
This commit is contained in:
@@ -9,6 +9,7 @@ on:
|
|||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-windows:
|
build-windows:
|
||||||
@@ -20,14 +21,16 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Rust toolchain
|
- name: Setup Rust toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: dtolnay/rust-action@stable
|
||||||
with:
|
with:
|
||||||
target: x86_64-pc-windows-gnu
|
targets: x86_64-pc-windows-gnu
|
||||||
profile: minimal
|
|
||||||
components: rustfmt, clippy
|
|
||||||
|
|
||||||
- name: Install MinGW
|
- 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
|
- name: Cache cargo registry
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@@ -42,38 +45,21 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir -p release
|
mkdir -p release
|
||||||
cp target/x86_64-pc-windows-gnu/release/readflow.exe release/
|
cp target/x86_64-pc-windows-gnu/release/readflow.exe release/
|
||||||
# Create README
|
|
||||||
cat > release/README.txt << 'EOF'
|
cat > release/README.txt << 'EOF'
|
||||||
ReadFlow v${{ github.ref_name }} for Windows
|
ReadFlow for Windows
|
||||||
|
|
||||||
快速开始:
|
|
||||||
1. 解压到任意目录
|
1. 解压到任意目录
|
||||||
2. 双击运行 readflow.exe
|
2. 双击运行 readflow.exe
|
||||||
|
|
||||||
功能:
|
|
||||||
- EPUB/MOBI/Markdown/PDF 阅读
|
|
||||||
- 20+ 编程语言语法高亮
|
|
||||||
- 双语翻译对照
|
|
||||||
- 笔记与书签系统
|
|
||||||
- 插件系统
|
|
||||||
- 主题商店
|
|
||||||
|
|
||||||
技术支持:damai@foshanhuiya.com
|
|
||||||
EOF
|
EOF
|
||||||
cd release
|
cd release
|
||||||
zip -r ../readflow-${{ github.ref_name }}-windows-x86_64.zip .
|
zip -r ../readflow-windows-x86_64.zip .
|
||||||
|
|
||||||
- name: Upload to Release
|
- name: Upload to Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: ncipollo/release-action@v1
|
||||||
with:
|
with:
|
||||||
name: Windows x86_64
|
artifacts: "readflow-windows-x86_64.zip"
|
||||||
files: readflow-${{ github.ref_name }}-windows-x86_64.zip
|
tag: ${{ github.ref_name }}
|
||||||
tag_name: ${{ github.ref_name }}
|
|
||||||
token: ${{ secrets.GITEA_TOKEN }}
|
token: ${{ secrets.GITEA_TOKEN }}
|
||||||
fail_on_unmatched_files: true
|
allowUpdates: true
|
||||||
env:
|
|
||||||
GITHUB_SERVER_URL: http://192.168.120.110:4000
|
|
||||||
GITHUB_REPOSITORY: damai/readflow
|
|
||||||
|
|
||||||
build-linux:
|
build-linux:
|
||||||
name: Build Linux
|
name: Build Linux
|
||||||
|
|||||||
Reference in New Issue
Block a user