Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

Commit

Permalink
Automatically build Meilisearch for CentOS 7
Browse files Browse the repository at this point in the history
  • Loading branch information
tillprochaska committed Nov 5, 2022
1 parent b79d8ae commit 254dcac
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
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
17 changes: 17 additions & 0 deletions .github/workflows/build.yml
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
14 changes: 14 additions & 0 deletions Dockerfile
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
15 changes: 15 additions & 0 deletions scripts/build
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

0 comments on commit 254dcac

Please sign in to comment.