mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-02-17 00:00:11 +08:00
Refactor CIs to publish aaarch64 binary
This commit is contained in:
parent
9448ca58aa
commit
c71c95feb0
77
.github/workflows/publish-binaries.yml
vendored
77
.github/workflows/publish-binaries.yml
vendored
@ -38,28 +38,69 @@ jobs:
|
|||||||
asset_name: ${{ matrix.asset_name }}
|
asset_name: ${{ matrix.asset_name }}
|
||||||
tag: ${{ github.ref }}
|
tag: ${{ github.ref }}
|
||||||
|
|
||||||
publish-armv8:
|
publish-aarch64:
|
||||||
name: Publish for ARMv8
|
name: Publish to Github
|
||||||
runs-on: ubuntu-18.04
|
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
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- name: Checkout repository
|
||||||
- uses: uraimo/run-on-arch-action@v2.1.1
|
uses: actions/checkout@v2
|
||||||
id: runcmd
|
|
||||||
|
- name: Installing Rust toolchain
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
arch: aarch64 # aka ARMv8
|
toolchain: stable
|
||||||
distro: ubuntu18.04
|
profile: minimal
|
||||||
env: |
|
target: ${{ matrix.target }}
|
||||||
JEMALLOC_SYS_WITH_LG_PAGE: 16
|
override: true
|
||||||
run: |
|
|
||||||
apt update
|
- name: APT update
|
||||||
apt install -y curl gcc make
|
run: |
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable
|
sudo apt update
|
||||||
source $HOME/.cargo/env
|
|
||||||
cargo build --release --locked
|
- 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:
|
||||||
|
# JEMALLOC_SYS_WITH_LG_PAGE: 16
|
||||||
|
# RUSTFLAGS: '-Clink-arg=-fuse-ld=gold'
|
||||||
|
run: |
|
||||||
|
echo '[target.aarch64-unknown-linux-gnu]' >> ~/.cargo/config
|
||||||
|
echo 'linker = "aarch64-linux-gnu-gcc"' >> ~/.cargo/config
|
||||||
|
echo 'JEMALLOC_SYS_WITH_LG_PAGE=16' >> $GITHUB_ENV
|
||||||
|
echo RUSTFLAGS="-Clink-arg=-fuse-ld=gold" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- 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
|
- name: Upload the binary to release
|
||||||
uses: svenstaro/upload-release-action@v1-release
|
uses: svenstaro/upload-release-action@v1-release
|
||||||
with:
|
with:
|
||||||
repo_token: ${{ secrets.PUBLISH_TOKEN }}
|
repo_token: ${{ secrets.PUBLISH_TOKEN }}
|
||||||
file: target/release/meilisearch
|
file: target/${{ matrix.target }}/release/meilisearch
|
||||||
asset_name: meilisearch-linux-armv8
|
asset_name: ${{ matrix.asset_name }}
|
||||||
tag: ${{ github.ref }}
|
tag: ${{ github.ref }}
|
||||||
|
76
.github/workflows/publish-crossbuild.yml
vendored
76
.github/workflows/publish-crossbuild.yml
vendored
@ -1,76 +0,0 @@
|
|||||||
name: Publish aarch64 binary
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
env:
|
|
||||||
CARGO_TERM_COLOR: always
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish-aarch64:
|
|
||||||
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
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- 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'
|
|
||||||
## 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'
|
|
||||||
run: |
|
|
||||||
echo '[target.aarch64-unknown-linux-gnu]' >> ~/.cargo/config
|
|
||||||
echo 'linker = "aarch64-linux-gnu-gcc"' >> ~/.cargo/config
|
|
||||||
echo 'JEMALLOC_SYS_WITH_LG_PAGE=16' >> $GITHUB_ENV
|
|
||||||
echo RUSTFLAGS="-Clink-arg=-fuse-ld=gold" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- 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 }}
|
|
Loading…
x
Reference in New Issue
Block a user