2019-11-26 00:27:15 +08:00
|
|
|
on:
|
2020-07-21 20:39:12 +08:00
|
|
|
release:
|
|
|
|
types: [published]
|
|
|
|
|
|
|
|
name: Publish binaries to release
|
2019-11-26 00:27:15 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish:
|
2022-03-14 21:20:25 +08:00
|
|
|
name: Publish binary for ${{ matrix.os }}
|
2019-11-26 00:27:15 +08:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
2021-12-08 16:42:58 +08:00
|
|
|
fail-fast: false
|
2019-11-26 00:27:15 +08:00
|
|
|
matrix:
|
2021-03-25 17:34:42 +08:00
|
|
|
os: [ubuntu-18.04, macos-latest, windows-latest]
|
2019-11-26 00:27:15 +08:00
|
|
|
include:
|
2021-03-25 17:34:42 +08:00
|
|
|
- os: ubuntu-18.04
|
2019-11-26 18:17:30 +08:00
|
|
|
artifact_name: meilisearch
|
|
|
|
asset_name: meilisearch-linux-amd64
|
2019-11-26 00:27:15 +08:00
|
|
|
- os: macos-latest
|
2019-11-26 18:17:30 +08:00
|
|
|
artifact_name: meilisearch
|
|
|
|
asset_name: meilisearch-macos-amd64
|
2019-12-07 18:52:14 +08:00
|
|
|
- os: windows-latest
|
2020-05-12 00:15:01 +08:00
|
|
|
artifact_name: meilisearch.exe
|
|
|
|
asset_name: meilisearch-windows-amd64.exe
|
2019-11-26 00:27:15 +08:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: hecrj/setup-rust-action@master
|
|
|
|
with:
|
|
|
|
rust-version: stable
|
2022-06-29 04:21:41 +08:00
|
|
|
- uses: actions/checkout@v3
|
2019-11-26 00:27:15 +08:00
|
|
|
- name: Build
|
|
|
|
run: cargo build --release --locked
|
|
|
|
- name: Upload binaries to release
|
|
|
|
uses: svenstaro/upload-release-action@v1-release
|
|
|
|
with:
|
2020-04-11 00:28:28 +08:00
|
|
|
repo_token: ${{ secrets.PUBLISH_TOKEN }}
|
2019-11-26 00:27:15 +08:00
|
|
|
file: target/release/${{ matrix.artifact_name }}
|
|
|
|
asset_name: ${{ matrix.asset_name }}
|
|
|
|
tag: ${{ github.ref }}
|
2020-03-25 20:50:17 +08:00
|
|
|
|
2022-02-03 02:25:28 +08:00
|
|
|
publish-aarch64:
|
2022-03-14 21:20:25 +08:00
|
|
|
name: Publish binary for aarch64
|
2022-02-03 02:25:28 +08:00
|
|
|
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
|
|
|
|
|
2020-04-03 16:39:28 +08:00
|
|
|
steps:
|
2022-02-03 02:25:28 +08:00
|
|
|
- name: Checkout repository
|
2022-06-29 04:21:41 +08:00
|
|
|
uses: actions/checkout@v3
|
2022-02-03 02:25:28 +08:00
|
|
|
|
|
|
|
- name: Installing Rust toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
2020-04-03 16:39:28 +08:00
|
|
|
with:
|
2022-02-03 02:25:28 +08:00
|
|
|
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
|
|
|
|
|
2020-04-03 16:39:28 +08:00
|
|
|
- name: Upload the binary to release
|
|
|
|
uses: svenstaro/upload-release-action@v1-release
|
|
|
|
with:
|
2020-04-11 00:28:28 +08:00
|
|
|
repo_token: ${{ secrets.PUBLISH_TOKEN }}
|
2022-02-03 02:25:28 +08:00
|
|
|
file: target/${{ matrix.target }}/release/meilisearch
|
|
|
|
asset_name: ${{ matrix.asset_name }}
|
2020-04-03 16:39:28 +08:00
|
|
|
tag: ${{ github.ref }}
|