Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
chore: adding cross compilation (#400)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Paitrault <[email protected]>
  • Loading branch information
Freyskeyd authored Dec 7, 2023
1 parent 60f873c commit 887762f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
21 changes: 7 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,24 @@ jobs:
rust: stable
os: ubuntu-latest-16-core
target: x86_64-unknown-linux-gnu

- build: linux
rust: stable
os: ubuntu-latest-16-core
target: x86_64-unknown-linux-musl

- build: stable-aarch64
rust: stable
os: ubuntu-latest-16-core
target: aarch64-unknown-linux-gnu

steps:
- uses: actions/checkout@v4
- name: Install packages (Ubuntu)
if: matrix.os == 'ubuntu-latest-16-core'
shell: bash
run: |
if ! command -V sudo; then
apt-get update
apt-get install -y --no-install-recommends sudo
fi
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
zsh xz-utils liblz4-tool musl-tools brotli zstd
- uses: ./.github/actions/install-rust
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
with_cache: false
AWS_ACCESS_KEY_ID: ${{ secrets.ROBOT_AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{ secrets.ROBOT_AWS_SECRET_ACCESS_KEY}}

- name: Use Cross
if: matrix.os == 'ubuntu-latest-16-core' && matrix.target != ''
Expand Down
11 changes: 11 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[build]
pre-build = [
"apt update && apt install -y unzip",
"curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v25.1/protoc-25.1-linux-x86_64.zip && unzip protoc-25.1-linux-x86_64.zip -d /usr/ && chmod 755 /usr/bin/protoc"
]

[target.x86_64-unknown-linux-gnu]
image = "ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main"

[target.aarch64-unknown-linux-gnu]
image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main"

0 comments on commit 887762f

Please sign in to comment.