mirror of
https://github.com/FranP-code/TurboRun.git
synced 2025-10-13 00:14:01 +00:00
Update release.yml
This commit is contained in:
312
.github/workflows/release.yml
vendored
312
.github/workflows/release.yml
vendored
@@ -1,155 +1,191 @@
|
|||||||
|
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:
|
||||||
build-chatgpt:
|
check-version:
|
||||||
|
name: Check the version validity
|
||||||
|
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 --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/meilisearch
|
||||||
|
asset_name: meilisearch-linux-amd64
|
||||||
|
tag: ${{ github.ref }}
|
||||||
|
|
||||||
|
publish-macos-windows:
|
||||||
|
name: Publish binary for ${{ matrix.os }}
|
||||||
runs-on: ${{ 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:
|
||||||
- build: linux
|
- os: macos-12
|
||||||
os: ubuntu-latest
|
artifact_name: meilisearch
|
||||||
arch: x86_64
|
asset_name: meilisearch-macos-amd64
|
||||||
target: x86_64-unknown-linux-gnu
|
- os: windows-2022
|
||||||
- build: macos
|
artifact_name: meilisearch.exe
|
||||||
os: macos-latest
|
asset_name: meilisearch-windows-amd64.exe
|
||||||
arch: x86_64
|
|
||||||
target: x86_64-apple-darwin
|
|
||||||
- build: macos
|
|
||||||
os: macos-latest
|
|
||||||
arch: aarch64
|
|
||||||
target: aarch64-apple-darwin
|
|
||||||
- build: windows
|
|
||||||
os: windows-latest
|
|
||||||
arch: x86_64
|
|
||||||
target: x86_64-pc-windows-msvc
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
- 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.5.0
|
||||||
|
with:
|
||||||
|
repo_token: ${{ secrets.MEILI_BOT_GH_PAT }}
|
||||||
|
file: target/release/${{ matrix.artifact_name }}
|
||||||
|
asset_name: ${{ matrix.asset_name }}
|
||||||
|
tag: ${{ github.ref }}
|
||||||
|
|
||||||
# - uses: pnpm/action-setup@v2
|
publish-macos-apple-silicon:
|
||||||
# name: Install pnpm
|
name: Publish binary for macOS silicon
|
||||||
# id: pnpm-install
|
runs-on: macos-12
|
||||||
# with:
|
needs: check-version
|
||||||
# version: 7
|
strategy:
|
||||||
# run_install: false
|
matrix:
|
||||||
|
include:
|
||||||
# - name: Install Node.js
|
- target: aarch64-apple-darwin
|
||||||
# uses: actions/setup-node@v3
|
asset_name: meilisearch-macos-apple-silicon
|
||||||
# with:
|
steps:
|
||||||
# node-version: 18
|
- name: Checkout repository
|
||||||
# cache: pnpm
|
uses: actions/checkout@v3
|
||||||
# - run: pnpm install --frozen-lockfile
|
- name: Installing Rust toolchain
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
- name: 'Setup Rust'
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
with:
|
with:
|
||||||
targets: ${{ matrix.target }}
|
toolchain: stable
|
||||||
- uses: Swatinem/rust-cache@v2
|
profile: minimal
|
||||||
|
target: ${{ matrix.target }}
|
||||||
|
override: true
|
||||||
|
- name: Cargo build
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
key: ${{ matrix.target }}
|
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 }}
|
||||||
|
|
||||||
- name: Install xattr (macos only)
|
publish-aarch64:
|
||||||
if: matrix.os == 'macos-latest'
|
name: Publish binary for aarch64
|
||||||
run: pip install xattr
|
runs-on: ubuntu-latest
|
||||||
|
needs: check-version
|
||||||
- name: Install dependencies (ubuntu only)
|
container:
|
||||||
if: matrix.os == 'ubuntu-latest'
|
# 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: |
|
run: |
|
||||||
sudo apt-get update
|
apt-get update -y && apt upgrade -y
|
||||||
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
|
apt-get install -y curl build-essential gcc-aarch64-linux-gnu
|
||||||
|
- name: Set up Docker for cross compilation
|
||||||
# - name: Build FE
|
run: |
|
||||||
# run: pnpm build:fe
|
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 -
|
||||||
- name: Install rust target
|
add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
||||||
run: rustup target add ${{ matrix.target }}
|
apt-get update -y && apt-get install -y docker-ce
|
||||||
|
- name: Installing Rust toolchain
|
||||||
# - name: fix tray icon
|
uses: actions-rs/toolchain@v1
|
||||||
# if: matrix.os != 'macos-latest'
|
with:
|
||||||
# run: |
|
toolchain: stable
|
||||||
# pnpm fix:tray
|
profile: minimal
|
||||||
|
target: ${{ matrix.target }}
|
||||||
- run: cargo build --release --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:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
CROSS_DOCKER_IN_DOCKER: true
|
||||||
|
- name: List target output files
|
||||||
- uses: actions/upload-artifact@v3
|
run: ls -lR ./target
|
||||||
if: matrix.os == 'ubuntu-latest'
|
- 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:
|
with:
|
||||||
name: artifacts-${{ matrix.arch }}
|
repo_token: ${{ secrets.MEILI_BOT_GH_PAT }}
|
||||||
path: |
|
file: target/${{ matrix.target }}/release/meilisearch
|
||||||
./target/${{ matrix.target }}/release/bundle/appimage/**.AppImage.*
|
asset_name: ${{ matrix.asset_name }}
|
||||||
./target/${{ matrix.target }}/release/bundle/deb/**.deb
|
tag: ${{ github.ref }}
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
if: matrix.os == 'macos-latest'
|
|
||||||
with:
|
|
||||||
name: artifacts-${{ matrix.arch }}
|
|
||||||
path: |
|
|
||||||
./target/${{ matrix.target }}/release/bundle/dmg/**.dmg
|
|
||||||
./target/${{ matrix.target }}/release/bundle/macos/**.app.*
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
if: matrix.os == 'windows-latest'
|
|
||||||
with:
|
|
||||||
name: artifacts-${{ matrix.arch }}
|
|
||||||
path: |
|
|
||||||
./target/${{ matrix.target }}/release/bundle/msi/**
|
|
||||||
release-chatgpt:
|
|
||||||
needs: build-chatgpt
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install xattr
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y xattr
|
|
||||||
|
|
||||||
- name: Query version number
|
|
||||||
run: echo "version=${GITHUB_REF:11}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Download x86_64 artifacts
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: artifacts-x86_64
|
|
||||||
path: artifacts/x86_64
|
|
||||||
|
|
||||||
- name: Download aarch64 artifacts
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: artifacts-aarch64
|
|
||||||
path: artifacts/aarch64
|
|
||||||
|
|
||||||
- name: Rename artifacts
|
|
||||||
run: |
|
|
||||||
mv "artifacts/aarch64/dmg/ChatGPT_${{ env.version }}_aarch64.dmg" "artifacts/ChatGPT_${{ env.version }}_macos_aarch64.dmg"
|
|
||||||
mv "artifacts/aarch64/macos/ChatGPT.app.tar.gz" "artifacts/ChatGPT_${{ env.version }}_macos_aarch64.app.tar.gz"
|
|
||||||
mv "artifacts/aarch64/macos/ChatGPT.app.tar.gz.sig" "artifacts/ChatGPT_${{ env.version }}_macos_aarch64.app.tar.gz.sig"
|
|
||||||
|
|
||||||
mv "artifacts/x86_64/dmg/ChatGPT_${{ env.version }}_x64.dmg" "artifacts/ChatGPT_${{ env.version }}_macos_x86_64.dmg"
|
|
||||||
mv "artifacts/x86_64/macos/ChatGPT.app.tar.gz" "artifacts/ChatGPT_${{ env.version }}_macos_x86_64.app.tar.gz"
|
|
||||||
mv "artifacts/x86_64/macos/ChatGPT.app.tar.gz.sig" "artifacts/ChatGPT_${{ env.version }}_macos_x86_64.app.tar.gz.sig"
|
|
||||||
|
|
||||||
mv "artifacts/x86_64/deb/chat-gpt_${{ env.version }}_amd64.deb" "artifacts/x86_64/deb/ChatGPT_${{ env.version }}_linux_x86_64.deb"
|
|
||||||
mv "artifacts/x86_64/appimage/chat-gpt_${{ env.version }}_amd64.AppImage.tar.gz" "artifacts/ChatGPT_${{ env.version }}_linux_x86_64.AppImage.tar.gz"
|
|
||||||
mv "artifacts/x86_64/appimage/chat-gpt_${{ env.version }}_amd64.AppImage.tar.gz.sig" "artifacts/ChatGPT_${{ env.version }}_linux_x86_64.AppImage.tar.gz.sig"
|
|
||||||
|
|
||||||
mv "artifacts/x86_64/ChatGPT_${{ env.version }}_x64_en-US.msi" "artifacts/ChatGPT_${{ env.version }}_windows_x86_64.msi"
|
|
||||||
mv "artifacts/x86_64/ChatGPT_${{ env.version }}_x64_en-US.msi.zip" "artifacts/ChatGPT_${{ env.version }}_windows_x86_64.msi.zip"
|
|
||||||
mv "artifacts/x86_64/ChatGPT_${{ env.version }}_x64_en-US.msi.zip.sig" "artifacts/ChatGPT_${{ env.version }}_windows_x86_64.msi.zip.sig"
|
|
||||||
|
|
||||||
- name: Create Release
|
|
||||||
uses: softprops/action-gh-release@master
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
tag_name: v${{ env.version }}
|
|
||||||
name: ChatGPT v${{ env.version }}
|
|
||||||
body: See the assets to download this version and install.
|
|
||||||
prerelease: false
|
|
||||||
generate_release_notes: false
|
|
||||||
files: ./artifacts/**/*
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user