-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): cross-compilation of Rust Binary (#3)
* chore: tentative of arm cross-compilation * chore: master -> main * chore: rustup option * chore: install gcc for arm linux * chore: linker erro * chore: linker cargo flag * chore: use cross instead of cargo * chore: release build * chore: install libpq in cross docker env
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Build | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the main branch | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Setup Rust Toolchain | ||
run: | | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --profile minimal --no-modify-path -y | ||
# the target comes from running `rustup target list` on the Olimex board | ||
rustup target add armv7-unknown-linux-gnueabihf | ||
cargo install cross --git https://github.com/cross-rs/cross | ||
sudo apt-get install -y gcc-arm-linux-gnueabihf | ||
- name: Build | ||
run: cross build --release --target=armv7-unknown-linux-gnueabihf | ||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
target/release/eye | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters