Skip to content

Commit 8d97e17

Browse files
committed
fix: 修复 linux 平台的构建
1 parent d84dccc commit 8d97e17

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

.github/workflows/release-agent.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@ jobs:
4747
with:
4848
targets: ${{ matrix.target }}
4949

50-
- name: Install cross-compilation tools (Linux aarch64)
51-
if: matrix.cross == true
52-
run: |
53-
sudo apt-get update
54-
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
55-
5650
- name: Cache cargo registry
5751
uses: actions/cache@v4
5852
with:
@@ -72,12 +66,19 @@ jobs:
7266
${{ runner.os }}-${{ matrix.target }}-build-
7367
${{ runner.os }}-${{ matrix.target }}-
7468
75-
- name: Build agent-tui
76-
run: cargo build -p rust-agent-tui --release --target ${{ matrix.target }}
69+
- name: Install cross (Linux)
70+
if: matrix.os == 'ubuntu-latest'
71+
run: cargo install cross --git https://github.com/cross-rs/cross
72+
73+
- name: Build agent-tui (Linux)
74+
if: matrix.os == 'ubuntu-latest'
75+
run: cross build -p rust-agent-tui --release --target ${{ matrix.target }}
7776
env:
78-
CC: ${{ matrix.cross && 'aarch64-linux-gnu-gcc' || '' }}
79-
CXX: ${{ matrix.cross && 'aarch64-linux-gnu-g++' || '' }}
80-
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: ${{ matrix.cross && 'aarch64-linux-gnu-gcc' || '' }}
77+
CROSS_CONTAINER_IN_CONTAINER: 1
78+
79+
- name: Build agent-tui (non-Linux)
80+
if: matrix.os != 'ubuntu-latest'
81+
run: cargo build -p rust-agent-tui --release --target ${{ matrix.target }}
8182

8283
- name: Package binaries (Unix)
8384
if: matrix.ext == ''

0 commit comments

Comments
 (0)