Skip to content

Commit

Permalink
try using cross to cross compile
Browse files Browse the repository at this point in the history
  • Loading branch information
amsam0 committed Mar 5, 2023
1 parent bc3af25 commit 7b0608c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ jobs:
- name: Install rust targets
run: rustup target add x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu

- name: Install cross compilation dependencies
run: sudo apt install gcc-aarch64-linux-gnu
- name: Install cross
run: cargo install cross

- name: Cache rust
uses: Swatinem/rust-cache@v2

- name: Build for x86_64
run: cargo build --release --target x86_64-unknown-linux-gnu
run: cargo build --release

- name: Build for aarch64
run: TARGET_CC=/usr/bin/aarch64-linux-gnu-gcc TARGET_AR=/usr/bin/aarch64-linux-gnu-gcc-ar cargo build --release --target aarch64-unknown-linux-gnu
run: cross build --release --target aarch64-unknown-linux-gnu

- name: Rename binaries
- name: Move and rename binaries
run: |
cp target/x86_64-unknown-linux-gnu/release/omnisette-server target/omnisette-server-linux-x86_64
cp target/release/omnisette-server target/omnisette-server-linux-x86_64
cp target/aarch64-unknown-linux-gnu/release/omnisette-server target/omnisette-server-linux-aarch64
- name: Upload to new release
Expand Down

0 comments on commit 7b0608c

Please sign in to comment.