fix: 修复 workflow
Some checks failed
Release / build (push) Has been cancelled

- 移除 matrix strategy(单 job 构建)
- 移除 artifacts(直接上传)
- 所有平台在一个 step 中构建
This commit is contained in:
2026-04-24 03:41:10 +08:00
parent eda35d9675
commit e31eb547a9

View File

@@ -8,54 +8,33 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu24.04 runs-on: ubuntu24.04
strategy:
matrix:
target:
- os: linux
arch: amd64
- os: linux
arch: arm64
- os: darwin
arch: amd64
- os: darwin
arch: arm64
- os: windows
arch: amd64
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
. ~/.cargo/env
- name: Build - name: Build
run: | run: |
ext="" . ~/.cargo/env
[ "${{ matrix.target.os }}" = "windows" ] && ext=".exe"
GOOS=${{ matrix.target.os }} GOARCH=${{ matrix.target.arch }} cargo build --release -p mimo-tts
mv target/release/mimo-tts "mimo-tts-${{ matrix.target.os }}-${{ matrix.target.arch }}${ext}"
- name: Upload artifact for target in linux-amd64 linux-arm64 darwin-amd64 darwin-arm64 windows-amd64; do
uses: actions/upload-artifact@v4 os=${target%-*}
with: arch=${target#*-}
name: mimo-tts-${{ matrix.target.os }}-${{ matrix.target.arch }} ext=""
path: mimo-tts-* [ "$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
release: - name: Checksums
needs: build
runs-on: ubuntu24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create checksums
run: | run: |
cd artifacts
sha256sum mimo-tts-* > checksums.txt sha256sum mimo-tts-* > checksums.txt
- name: Create release - name: Upload release
env: env:
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }} GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: | run: |
@@ -75,7 +54,7 @@ jobs:
RELEASE_ID=$(echo "$RELEASE_RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2) RELEASE_ID=$(echo "$RELEASE_RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
for f in artifacts/*; do for f in mimo-tts-* checksums.txt; do
[ -f "$f" ] && curl -s -X POST "${GITEA_URL}/api/v1/repos/${REPO}/releases/${RELEASE_ID}/assets" \ [ -f "$f" ] && curl -s -X POST "${GITEA_URL}/api/v1/repos/${REPO}/releases/${RELEASE_ID}/assets" \
-H "Authorization: token ${GITEA_TOKEN}" \ -H "Authorization: token ${GITEA_TOKEN}" \
-F "attachment=@$f" -F "attachment=@$f"