This repository has been archived by the owner on Apr 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically build Meilisearch for CentOS 7
- Loading branch information
1 parent
b79d8ae
commit 254dcac
Showing
5 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.{yml,yaml}] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Build | ||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build Meilisearch binary | ||
run: MEILISEARCH_VERSION="0.28.1" ./scripts/build | ||
|
||
- name: Create release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: ./build/meilisearch-0.28.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM centos:7 | ||
ARG MEILISEARCH_VERSION | ||
|
||
# Install Rust | ||
RUN yum group install -y "Development Tools" | ||
RUN curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
|
||
# Download and extract Meilisearch source | ||
RUN curl -L "https://github.com/meilisearch/meilisearch/archive/refs/tags/v${MEILISEARCH_VERSION}.tar.gz" > meilisearch.tar.gz | ||
RUN tar zxf meilisearch.tar.gz | ||
|
||
# Build | ||
WORKDIR "meilisearch-${MEILISEARCH_VERSION}" | ||
RUN ~/.cargo/bin/cargo build --release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Build Meilisearch binary in Docker | ||
docker build \ | ||
--tag meilisearch-centos7:${MEILISEARCH_VERSION} \ | ||
--build-arg MEILISEARCH_VERSION=${MEILISEARCH_VERSION} \ | ||
. | ||
|
||
# Copy Meilisearch binary from image | ||
mkdir build | ||
id=$(docker create meilisearch-centos7:${MEILISEARCH_VERSION}) | ||
docker cp $id:/meilisearch-${MEILISEARCH_VERSION}/target/release/meilisearch ./build/meilisearch-${MEILISEARCH_VERSION} | ||
docker rm $id |