mirror of
https://github.com/FranP-code/TurboRun.git
synced 2025-10-13 00:14:01 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cfcc6ce9f2 | |||
| b22f199eeb | |||
| b350e1322a | |||
| aafadd7804 | |||
| 3e22f703d8 | |||
| 93dfcb58fe | |||
| 52373b9cf7 |
3
.gitattributes
vendored
Normal file
3
.gitattributes
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
*.Dockerfile linguist-vendored
|
||||||
|
*/Dockerfile linguist-vendored
|
||||||
|
*.docker-compose.yml linguist-vendored
|
||||||
194
.github/workflows/release.yml
vendored
194
.github/workflows/release.yml
vendored
@@ -1,27 +1,189 @@
|
|||||||
|
name: Publish binaries to GitHub release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 2 * * *' # Every day at 2:00am
|
||||||
release:
|
release:
|
||||||
types: [created]
|
types: [published]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
check-version:
|
||||||
name: release ${{ matrix.target }}
|
name: Check the version validity
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
# No need to check the version for dry run (cron)
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
# Check if the tag has the v<nmumber>.<number>.<number> format.
|
||||||
|
# If yes, it means we are publishing an official release.
|
||||||
|
# If no, we are releasing a RC, so no need to check the version.
|
||||||
|
- name: Check tag format
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
id: check-tag-format
|
||||||
|
run: |
|
||||||
|
escaped_tag=$(printf "%q" ${{ github.ref_name }})
|
||||||
|
|
||||||
|
if [[ $escaped_tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||||
|
echo "stable=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "stable=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
- name: Check release validity
|
||||||
|
if: github.event_name == 'release' && steps.check-tag-format.outputs.stable == 'true'
|
||||||
|
run: bash .github/scripts/check-release.sh
|
||||||
|
|
||||||
|
publish-linux:
|
||||||
|
name: Publish binary for Linux
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: check-version
|
||||||
|
container:
|
||||||
|
# Use ubuntu-18.04 to compile with glibc 2.27
|
||||||
|
image: ubuntu:18.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Install needed dependencies
|
||||||
|
run: |
|
||||||
|
apt-get update && apt-get install -y curl
|
||||||
|
apt-get install build-essential -y
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
override: true
|
||||||
|
- name: Build
|
||||||
|
run: cargo build --release
|
||||||
|
- name: Upload binaries to release
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
uses: svenstaro/upload-release-action@2.5.0
|
||||||
|
with:
|
||||||
|
file: target/release/meilisearch
|
||||||
|
asset_name: meilisearch-linux-amd64
|
||||||
|
tag: ${{ github.ref }}
|
||||||
|
|
||||||
|
publish-macos-windows:
|
||||||
|
name: Publish binary for ${{ matrix.os }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
needs: check-version
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
os: [macos-12, windows-2022]
|
||||||
include:
|
include:
|
||||||
- target: x86_64-pc-windows-gnu
|
- os: macos-12
|
||||||
archive: zip
|
artifact_name: meilisearch
|
||||||
- target: x86_64-unknown-linux-musl
|
asset_name: meilisearch-macos-amd64
|
||||||
archive: tar.gz tar.xz tar.zst
|
- os: windows-2022
|
||||||
- target: x86_64-apple-darwin
|
artifact_name: meilisearch.exe
|
||||||
archive: zip
|
asset_name: meilisearch-windows-amd64.exe
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v3
|
||||||
- name: Compile and release
|
- uses: actions-rs/toolchain@v1
|
||||||
uses: rust-build/rust-build.action@v1.4.3
|
with:
|
||||||
env:
|
toolchain: stable
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
override: true
|
||||||
|
- name: Build
|
||||||
|
run: cargo build --release --locked
|
||||||
|
# No need to upload binaries for dry run (cron)
|
||||||
|
- name: Upload binaries to release
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
uses: svenstaro/upload-release-action@2.5.0
|
||||||
|
with:
|
||||||
|
repo_token: ${{ secrets.MEILI_BOT_GH_PAT }}
|
||||||
|
file: target/release/${{ matrix.artifact_name }}
|
||||||
|
asset_name: ${{ matrix.asset_name }}
|
||||||
|
tag: ${{ github.ref }}
|
||||||
|
|
||||||
|
publish-macos-apple-silicon:
|
||||||
|
name: Publish binary for macOS silicon
|
||||||
|
runs-on: macos-12
|
||||||
|
needs: check-version
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- target: aarch64-apple-darwin
|
||||||
|
asset_name: meilisearch-macos-apple-silicon
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Installing Rust toolchain
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
RUSTTARGET: ${{ matrix.target }}
|
toolchain: stable
|
||||||
ARCHIVE_TYPES: ${{ matrix.archive }}
|
profile: minimal
|
||||||
|
target: ${{ matrix.target }}
|
||||||
|
override: true
|
||||||
|
- name: Cargo build
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: build
|
||||||
|
args: --release --target ${{ matrix.target }}
|
||||||
|
- name: Upload the binary to release
|
||||||
|
# No need to upload binaries for dry run (cron)
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
uses: svenstaro/upload-release-action@2.5.0
|
||||||
|
with:
|
||||||
|
repo_token: ${{ secrets.MEILI_BOT_GH_PAT }}
|
||||||
|
file: target/${{ matrix.target }}/release/meilisearch
|
||||||
|
asset_name: ${{ matrix.asset_name }}
|
||||||
|
tag: ${{ github.ref }}
|
||||||
|
|
||||||
|
publish-aarch64:
|
||||||
|
name: Publish binary for aarch64
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: check-version
|
||||||
|
container:
|
||||||
|
# Use ubuntu-18.04 to compile with glibc 2.27
|
||||||
|
image: ubuntu:18.04
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- target: aarch64-unknown-linux-gnu
|
||||||
|
asset_name: meilisearch-linux-aarch64
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Install needed dependencies
|
||||||
|
run: |
|
||||||
|
apt-get update -y && apt upgrade -y
|
||||||
|
apt-get install -y curl build-essential gcc-aarch64-linux-gnu
|
||||||
|
- name: Set up Docker for cross compilation
|
||||||
|
run: |
|
||||||
|
apt-get install -y curl apt-transport-https ca-certificates software-properties-common
|
||||||
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
|
||||||
|
add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
||||||
|
apt-get update -y && apt-get install -y docker-ce
|
||||||
|
- name: Installing Rust toolchain
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
profile: minimal
|
||||||
|
target: ${{ matrix.target }}
|
||||||
|
override: true
|
||||||
|
- name: Configure target aarch64 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
|
||||||
|
- name: Cargo build
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: build
|
||||||
|
use-cross: true
|
||||||
|
args: --release --target ${{ matrix.target }}
|
||||||
|
env:
|
||||||
|
CROSS_DOCKER_IN_DOCKER: true
|
||||||
|
- name: List target output files
|
||||||
|
run: ls -lR ./target
|
||||||
|
- name: Upload the binary to release
|
||||||
|
# No need to upload binaries for dry run (cron)
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
uses: svenstaro/upload-release-action@2.5.0
|
||||||
|
with:
|
||||||
|
repo_token: ${{ secrets.MEILI_BOT_GH_PAT }}
|
||||||
|
file: target/${{ matrix.target }}/release/meilisearch
|
||||||
|
asset_name: ${{ matrix.asset_name }}
|
||||||
|
tag: ${{ github.ref }}
|
||||||
13
Dockerfiles/node (npm)/Dockerfile
Normal file
13
Dockerfiles/node (npm)/Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
FROM mhart/alpine-node:14
|
||||||
|
|
||||||
|
RUN apk add curl
|
||||||
|
|
||||||
|
COPY [".", "/usr/src"]
|
||||||
|
|
||||||
|
WORKDIR "/usr/src"
|
||||||
|
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
ARG NODE_ENV
|
||||||
|
|
||||||
|
CMD if [ "$NODE_ENV" = "develop" ] ; then npm run dev ; else npm run start ; fi
|
||||||
10
Dockerfiles/node (yarn)/docker-compose.yml
Normal file
10
Dockerfiles/node (yarn)/docker-compose.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
version: "2.9"
|
||||||
|
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
build: .
|
||||||
|
volumes:
|
||||||
|
- .:/usr/src
|
||||||
|
- /usr/src/node_modules
|
||||||
|
environment:
|
||||||
|
NODE_ENV: ${NODE_ENV}
|
||||||
Reference in New Issue
Block a user