Use ubuntu-18.04 container in publish CIs

This commit is contained in:
curquiza 2022-12-19 18:35:33 +01:00
parent 913eff5b2f
commit 5099a40484
3 changed files with 46 additions and 23 deletions

View File

@ -32,30 +32,55 @@ jobs:
if: github.event_name == 'release' && steps.check-tag-format.outputs.stable == 'true' if: github.event_name == 'release' && steps.check-tag-format.outputs.stable == 'true'
run: bash .github/scripts/check-release.sh run: bash .github/scripts/check-release.sh
publish: publish-linux:
name: Publish binary for Linux
runs-on: ubuntu-latest
needs: check-version
container:
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 --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.3.0
with:
repo_token: ${{ secrets.MEILI_BOT_GH_PAT }}
file: target/release/meilisearch
asset_name: meilisearch-linux-amd64
tag: ${{ github.ref }}
publish-macos-windows:
name: Publish binary for ${{ matrix.os }} name: Publish binary for ${{ matrix.os }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
needs: check-version needs: check-version
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-18.04, macos-latest, windows-latest] os: [macos-latest, windows-latest]
include: include:
- os: ubuntu-18.04
artifact_name: meilisearch
asset_name: meilisearch-linux-amd64
- os: macos-latest - os: macos-latest
artifact_name: meilisearch artifact_name: meilisearch
asset_name: meilisearch-macos-amd64 asset_name: meilisearch-macos-amd64
- os: windows-latest - os: windows-latest
artifact_name: meilisearch.exe artifact_name: meilisearch.exe
asset_name: meilisearch-windows-amd64.exe asset_name: meilisearch-windows-amd64.exe
steps: steps:
- uses: hecrj/setup-rust-action@master
with:
rust-version: stable
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Build - name: Build
run: cargo build --release --locked run: cargo build --release --locked
# No need to upload binaries for dry run (cron) # No need to upload binaries for dry run (cron)
@ -80,7 +105,6 @@ jobs:
- os: macos-latest - os: macos-latest
target: aarch64-apple-darwin target: aarch64-apple-darwin
asset_name: meilisearch-macos-apple-silicon asset_name: meilisearch-macos-apple-silicon
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -121,11 +145,9 @@ jobs:
linker: gcc-aarch64-linux-gnu linker: gcc-aarch64-linux-gnu
use-cross: true use-cross: true
asset_name: meilisearch-linux-aarch64 asset_name: meilisearch-linux-aarch64
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Installing Rust toolchain - name: Installing Rust toolchain
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
@ -133,16 +155,13 @@ jobs:
profile: minimal profile: minimal
target: ${{ matrix.target }} target: ${{ matrix.target }}
override: true override: true
- name: APT update - name: APT update
run: | run: |
sudo apt update sudo apt update
- name: Install target specific tools - name: Install target specific tools
if: matrix.use-cross if: matrix.use-cross
run: | run: |
sudo apt-get install -y ${{ matrix.linker }} sudo apt-get install -y ${{ matrix.linker }}
- name: Configure target aarch64 GNU - name: Configure target aarch64 GNU
if: matrix.target == 'aarch64-unknown-linux-gnu' if: matrix.target == 'aarch64-unknown-linux-gnu'
## Environment variable is not passed using env: ## Environment variable is not passed using env:
@ -154,17 +173,14 @@ jobs:
echo '[target.aarch64-unknown-linux-gnu]' >> ~/.cargo/config echo '[target.aarch64-unknown-linux-gnu]' >> ~/.cargo/config
echo 'linker = "aarch64-linux-gnu-gcc"' >> ~/.cargo/config echo 'linker = "aarch64-linux-gnu-gcc"' >> ~/.cargo/config
echo 'JEMALLOC_SYS_WITH_LG_PAGE=16' >> $GITHUB_ENV echo 'JEMALLOC_SYS_WITH_LG_PAGE=16' >> $GITHUB_ENV
- name: Cargo build - name: Cargo build
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: build command: build
use-cross: ${{ matrix.use-cross }} use-cross: ${{ matrix.use-cross }}
args: --release --target ${{ matrix.target }} args: --release --target ${{ matrix.target }}
- name: List target output files - name: List target output files
run: ls -lR ./target run: ls -lR ./target
- name: Upload the binary to release - name: Upload the binary to release
# No need to upload binaries for dry run (cron) # No need to upload binaries for dry run (cron)
if: github.event_name == 'release' if: github.event_name == 'release'

View File

@ -15,12 +15,19 @@ jobs:
debian: debian:
name: Publish debian packagge name: Publish debian packagge
runs-on: ubuntu-18.04 runs-on: ubuntu-latest
needs: check-version needs: check-version
container:
image: ubuntu:18.04
steps: steps:
- uses: hecrj/setup-rust-action@master - 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: with:
rust-version: stable toolchain: stable
override: true
- name: Install cargo-deb - name: Install cargo-deb
run: cargo install cargo-deb run: cargo install cargo-deb
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@ -22,7 +22,7 @@ jobs:
image: ubuntu:18.04 image: ubuntu:18.04
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Install rustup - name: Install needed dependencies
run: | run: |
apt-get update && apt-get install -y curl apt-get update && apt-get install -y curl
apt-get install build-essential -y apt-get install build-essential -y
@ -73,7 +73,7 @@ jobs:
image: ubuntu:18.04 image: ubuntu:18.04
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Install rustup - name: Install needed dependencies
run: | run: |
apt-get update && apt-get install -y curl apt-get update && apt-get install -y curl
apt-get install build-essential -y apt-get install build-essential -y