Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross compile for aarch64 linux and macos #830

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 32 additions & 4 deletions .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,38 @@ jobs:
strategy:
fail-fast: false
matrix:
build: [linux, macos, win-msvc]
build: [linux-x86_64, linux-aarch64, macos-x86_64, macos-aarch64, win-msvc]
include:
- build: linux
- build: linux-x86_64
os: ubuntu-20.04
rust: stable
target: x86_64-unknown-linux-musl
- build: macos
cross: false
- build: linux-aarch64
os: ubuntu-20.04
rust: stable
target: aarch64-unknown-linux-musl
cross: true
- build: macos-x86_64
os: macos-latest
rust: stable
target: x86_64-apple-darwin
cross: false
- build: macos-aarch64
os: macos-latest
rust: stable
target: aarch64-apple-darwin
cross: true
- build: win-msvc
os: windows-2019
rust: stable
target: x86_64-pc-windows-msvc
cross: false
runs-on: ${{ matrix.os }}
env:
CARGO: cargo
CROSS_VERSION: "0.2.5"
continue-on-error: ${{ matrix.cross }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -89,8 +106,19 @@ jobs:
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
# Taken from https://github.com/rust-lang/regex project
- name: Install and configure Cross
if: matrix.cross
run: |
dir="$RUNNER_TEMP/cross-download"
mkdir "$dir"
echo "$dir" >> $GITHUB_PATH
cd "$dir"
curl -LO "https://github.com/cross-rs/cross/releases/download/v${CROSS_VERSION}/cross-x86_64-unknown-linux-musl.tar.gz"
tar xf cross-x86_64-unknown-linux-musl.tar.gz
echo "CARGO=cross" >> $GITHUB_ENV
- name: Build release binary
run: cargo build --target ${{ matrix.target }} --verbose --release
run: ${{ env.CARGO }} build --target ${{ matrix.target }} --verbose --release
- name: Build archive
shell: bash
run: |
Expand Down