添加用于编译 client-rust 的 GitHub Actions 工作流,当 main 分支的 client-rust 代码变更时自动触发。工作流包含 Rust 工具链安装、交叉编译和二进制文件上传步骤。
42 lines
977 B
YAML
42 lines
977 B
YAML
name: Compile Client Rust
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
paths:
|
|
- 'packages/client-rust/**'
|
|
pull_request:
|
|
branches: [ main ]
|
|
paths:
|
|
- 'packages/client-rust/**'
|
|
|
|
jobs:
|
|
compile:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
override: true
|
|
components: rustfmt, clippy
|
|
target: armv7-unknown-linux-gnueabihf
|
|
|
|
- name: Install cross
|
|
run: cargo install cross
|
|
|
|
- name: Compile client-rust
|
|
working-directory: packages/client-rust
|
|
run: cross build --release --target armv7-unknown-linux-gnueabihf
|
|
|
|
- name: Upload compiled binary
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: client-rust-binary
|
|
path: packages/client-rust/target/armv7-unknown-linux-gnueabihf/release/client
|
|
retention-days: 7
|