- 使用 rust:1.82 容器 - 使用阿里云 apk 镜像源 - 使用阿里云 cargo 镜像源 - 只构建 linux 版本
This commit is contained in:
39
.github/workflows/release.yml
vendored
39
.github/workflows/release.yml
vendored
@@ -8,28 +8,39 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu24.04
|
runs-on: ubuntu24.04
|
||||||
|
container:
|
||||||
|
image: rust:1.82
|
||||||
steps:
|
steps:
|
||||||
|
- name: Setup mirrors
|
||||||
|
run: |
|
||||||
|
# 使用阿里云 apk 镜像源
|
||||||
|
echo -e 'https://mirrors.aliyun.com/alpine/v3.20/main/\nhttps://mirrors.aliyun.com/alpine/v3.20/community/' > /etc/apk/repositories
|
||||||
|
apk add git
|
||||||
|
|
||||||
|
- name: Setup cargo mirror
|
||||||
|
run: |
|
||||||
|
# 使用阿里云 cargo 镜像源
|
||||||
|
mkdir -p ~/.cargo
|
||||||
|
echo '[source.crates-io]
|
||||||
|
replace-with = "ustc"
|
||||||
|
|
||||||
|
[source.ustc]
|
||||||
|
registry = "sparse+https://mirrors.ustc.edu.cn/crates.io/index/"' > ~/.cargo/config.toml
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
run: git clone https://hub.gaomia.site/titor/haibao-tts-cli.git /workspace/mimo-tts
|
run: git clone https://hub.gaomia.site/titor/haibao-tts-cli.git /workspace/mimo-tts
|
||||||
|
|
||||||
- name: Install Rust
|
|
||||||
run: |
|
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
||||||
. "$HOME/.cargo/env"
|
|
||||||
|
|
||||||
- name: Build binaries
|
- name: Build binaries
|
||||||
run: |
|
run: |
|
||||||
. "$HOME/.cargo/env"
|
|
||||||
cd /workspace/mimo-tts
|
cd /workspace/mimo-tts
|
||||||
|
|
||||||
for target in linux-amd64 linux-arm64 darwin-amd64 darwin-arm64 windows-amd64; do
|
# Linux x86_64
|
||||||
os=${target%-*}
|
cargo build --release -p mimo-tts
|
||||||
arch=${target#*-}
|
mv target/release/mimo-tts mimo-tts-linux-amd64
|
||||||
ext=""
|
|
||||||
[ "$os" = "windows" ] && ext=".exe"
|
# Linux ARM64
|
||||||
GOOS=$os GOARCH=$arch cargo build --release -p mimo-tts
|
GOOS=linux GOARCH=arm64 cargo build --release -p mimo-tts
|
||||||
mv target/release/mimo-tts "mimo-tts-${os}-${arch}${ext}"
|
mv target/release/mimo-tts mimo-tts-linux-arm64
|
||||||
done
|
|
||||||
|
|
||||||
- name: Generate checksums
|
- name: Generate checksums
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user