Skip to content

Commit 868a3f9

Browse files
committed
Attempt to handle all targets via cross
1 parent 2de1892 commit 868a3f9

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

.github/workflows/release.yml

+1-13
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ jobs:
6363

6464
steps:
6565
- uses: actions/checkout@v2
66+
- uses: taiki-e/install-action@cargo-cross
6667

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

75-
# Install cross compilation rust toolchain for Arm64 Mac
76-
- uses: actions-rust-lang/[email protected]
77-
with:
78-
target: ${{ matrix.target }}
79-
if: matrix.target == 'aarch64-apple-darwin'
80-
81-
# Run linux aarch64 build in a cross-rs qemu environment
82-
- name: Install cross-compilation tools
83-
uses: taiki-e/setup-cross-toolchain-action@v1
84-
with:
85-
target: ${{ matrix.target }}
86-
if: matrix.target == 'aarch64-unknown-linux-gnu'
87-
8876
- name: Check protobuf
8977
run: protoc --version; which protoc; echo "PROTOC IS ${PROTOC}";
9078

Cargo.toml

+8
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ pre-build = [
4545
"dpkg --add-architecture $CROSS_DEB_ARCH",
4646
"apt-get update && apt-get --assume-yes install protobuf-compiler:$CROSS_DEB_ARCH"
4747
]
48+
[workspace.metadata.cross.target.x86_64-apple-darwin]
49+
pre-build = [
50+
"brew install protobuf"
51+
]
52+
[workspace.metadata.cross.target.aarch64-apple-darwin]
53+
pre-build = [
54+
"brew install protobuf"
55+
]
4856

4957
[profile.release]
5058
lto = true # Optimize our binary at link stage.

0 commit comments

Comments
 (0)