Skip to content

Commit

Permalink
Attempt to handle all targets via cross
Browse files Browse the repository at this point in the history
  • Loading branch information
scottopell committed Mar 14, 2024
1 parent 2de1892 commit 868a3f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
14 changes: 1 addition & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: taiki-e/install-action@cargo-cross

- name: Install protobuf (Apt)
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
Expand All @@ -72,19 +73,6 @@ jobs:
run: brew install protobuf
if: matrix.os == 'macos-latest'

# Install cross compilation rust toolchain for Arm64 Mac
- uses: actions-rust-lang/[email protected]
with:
target: ${{ matrix.target }}
if: matrix.target == 'aarch64-apple-darwin'

# Run linux aarch64 build in a cross-rs qemu environment
- name: Install cross-compilation tools
uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.target }}
if: matrix.target == 'aarch64-unknown-linux-gnu'

- name: Check protobuf
run: protoc --version; which protoc; echo "PROTOC IS ${PROTOC}";

Expand Down
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get --assume-yes install protobuf-compiler:$CROSS_DEB_ARCH"
]
[workspace.metadata.cross.target.x86_64-apple-darwin]
pre-build = [
"brew install protobuf"
]
[workspace.metadata.cross.target.aarch64-apple-darwin]
pre-build = [
"brew install protobuf"
]

[profile.release]
lto = true # Optimize our binary at link stage.
Expand Down

0 comments on commit 868a3f9

Please sign in to comment.