diff --git a/.github/workflows/publish-binaries.yml b/.github/workflows/publish-binaries.yml index 13555cbac..76dde74d1 100644 --- a/.github/workflows/publish-binaries.yml +++ b/.github/workflows/publish-binaries.yml @@ -96,14 +96,12 @@ jobs: publish-macos-apple-silicon: name: Publish binary for macOS silicon - runs-on: ${{ matrix.os }} + runs-on: macos-12 needs: check-version strategy: - fail-fast: false matrix: include: - - os: macos-12 - target: aarch64-apple-darwin + - target: aarch64-apple-darwin asset_name: meilisearch-macos-apple-silicon steps: - name: Checkout repository @@ -132,21 +130,29 @@ jobs: publish-aarch64: name: Publish binary for aarch64 - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest needs: check-version + container: + # Use ubuntu-18.04 to compile with glibc 2.27 + image: ubuntu:18.04 strategy: - fail-fast: false matrix: include: - - build: aarch64 - os: ubuntu-18.04 - target: aarch64-unknown-linux-gnu - linker: gcc-aarch64-linux-gnu - use-cross: true + - target: aarch64-unknown-linux-gnu asset_name: meilisearch-linux-aarch64 steps: - name: Checkout repository uses: actions/checkout@v3 + - name: Install needed dependencies + run: | + apt-get update -y && apt upgrade -y + apt-get install -y curl build-essential gcc-aarch64-linux-gnu + - name: Set up Docker for cross compilation + run: | + apt-get install -y curl apt-transport-https ca-certificates software-properties-common + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - + add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" + apt-get update -y && apt-get install -y docker-ce - name: Installing Rust toolchain uses: actions-rs/toolchain@v1 with: @@ -154,15 +160,7 @@ jobs: profile: minimal target: ${{ matrix.target }} override: true - - name: APT update - run: | - sudo apt update - - name: Install target specific tools - if: matrix.use-cross - run: | - sudo apt-get install -y ${{ matrix.linker }} - name: Configure target aarch64 GNU - if: matrix.target == 'aarch64-unknown-linux-gnu' ## Environment variable is not passed using env: ## LD gold won't work with MUSL # env: @@ -176,8 +174,10 @@ jobs: uses: actions-rs/cargo@v1 with: command: build - use-cross: ${{ matrix.use-cross }} + use-cross: true args: --release --target ${{ matrix.target }} + env: + CROSS_DOCKER_IN_DOCKER: true - name: List target output files run: ls -lR ./target - name: Upload the binary to release