- 使用 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:
|
||||
build:
|
||||
runs-on: ubuntu24.04
|
||||
container:
|
||||
image: rust:1.82
|
||||
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
|
||||
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
|
||||
run: |
|
||||
. "$HOME/.cargo/env"
|
||||
cd /workspace/mimo-tts
|
||||
|
||||
for target in linux-amd64 linux-arm64 darwin-amd64 darwin-arm64 windows-amd64; do
|
||||
os=${target%-*}
|
||||
arch=${target#*-}
|
||||
ext=""
|
||||
[ "$os" = "windows" ] && ext=".exe"
|
||||
GOOS=$os GOARCH=$arch cargo build --release -p mimo-tts
|
||||
mv target/release/mimo-tts "mimo-tts-${os}-${arch}${ext}"
|
||||
done
|
||||
# Linux x86_64
|
||||
cargo build --release -p mimo-tts
|
||||
mv target/release/mimo-tts mimo-tts-linux-amd64
|
||||
|
||||
# Linux ARM64
|
||||
GOOS=linux GOARCH=arm64 cargo build --release -p mimo-tts
|
||||
mv target/release/mimo-tts mimo-tts-linux-arm64
|
||||
|
||||
- name: Generate checksums
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user