2021-10-24 13:31:04 +02:00
|
|
|
name: Publish aarch64 binary
|
2021-10-09 20:21:30 +02:00
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [published]
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
2021-10-21 19:02:16 +02:00
|
|
|
publish-aarch64:
|
2021-10-09 20:21:30 +02:00
|
|
|
name: Publish to Github
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
continue-on-error: false
|
|
|
|
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
|
|
|
|
asset_name: meilisearch-linux-aarch64
|
|
|
|
|
2021-10-21 19:02:00 +02:00
|
|
|
steps:
|
2021-10-09 20:21:30 +02:00
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Installing Rust toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
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'
|
2021-10-09 21:27:51 +02:00
|
|
|
## Environment variable is not passed using env:
|
|
|
|
## LD gold won't work with MUSL
|
|
|
|
# env:
|
|
|
|
# JEMALLOC_SYS_WITH_LG_PAGE: 16
|
|
|
|
# RUSTFLAGS: '-Clink-arg=-fuse-ld=gold'
|
2021-10-09 20:21:30 +02:00
|
|
|
run: |
|
|
|
|
echo '[target.aarch64-unknown-linux-gnu]' >> ~/.cargo/config
|
|
|
|
echo 'linker = "aarch64-linux-gnu-gcc"' >> ~/.cargo/config
|
2021-10-09 21:27:51 +02:00
|
|
|
echo 'JEMALLOC_SYS_WITH_LG_PAGE=16' >> $GITHUB_ENV
|
|
|
|
echo RUSTFLAGS="-Clink-arg=-fuse-ld=gold" >> $GITHUB_ENV
|
2021-10-09 20:21:30 +02:00
|
|
|
|
|
|
|
- name: Cargo build
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: build
|
|
|
|
use-cross: ${{ matrix.use-cross }}
|
|
|
|
args: --release --target ${{ matrix.target }}
|
|
|
|
|
|
|
|
- name: List target output files
|
|
|
|
run: ls -lR ./target
|
|
|
|
|
|
|
|
- name: Upload the binary to release
|
|
|
|
uses: svenstaro/upload-release-action@v1-release
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.PUBLISH_TOKEN }}
|
|
|
|
file: target/${{ matrix.target }}/release/meilisearch
|
|
|
|
asset_name: ${{ matrix.asset_name }}
|
|
|
|
tag: ${{ github.ref }}
|