2 Commits

Author SHA1 Message Date
21e4710829 fix: upload release assets with correct API endpoint
All checks were successful
Release / build (push) Successful in 11m33s
2026-04-07 09:17:11 +08:00
0b102dcb2a chore: add yoo to gitignore 2026-04-07 09:06:59 +08:00
2 changed files with 11 additions and 6 deletions

View File

@@ -41,17 +41,20 @@ jobs:
GITEA_TOKEN: ${{ secrets.release_token }}
run: |
apk add curl
TAG_NAME="${GITHUB_REF#refs/tags/}"
# 创建 Release
curl -s -X POST "https://hub.gaomia.site/api/v1/repos/titor/yoyo/releases" \
# 创建 Release 并获取 release_id
RELEASE_RESPONSE=$(curl -s -X POST "https://hub.gaomia.site/api/v1/repos/titor/yoyo/releases" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"${TAG_NAME}\",\"name\":\"${TAG_NAME}\",\"body\":\"Automated release\"}"
-d "{\"tag_name\":\"${TAG_NAME}\",\"name\":\"${TAG_NAME}\",\"body\":\"Automated release\"}")
# 上传产物
RELEASE_ID=$(echo "$RELEASE_RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
# 上传附件
for f in yoo-* checksums.txt; do
[ -f "$f" ] && curl -s -X POST "https://hub.gaomia.site/api/v1/repos/titor/yoyo/releases/upload?name=${TAG_NAME}" \
[ -f "$f" ] && curl -s -X POST "https://hub.gaomia.site/api/v1/repos/titor/yoyo/releases/${RELEASE_ID}/assets" \
-H "Authorization: token ${GITEA_TOKEN}" \
-F "attachment=@$f"
done

4
.gitignore vendored
View File

@@ -5,6 +5,7 @@ yoyo
*.dll
*.so
*.dylib
yoo
# 测试
*.test
@@ -27,6 +28,7 @@ vendor/
# 构建输出
dist/
build/
project/
# Go工作区
go.work
@@ -34,4 +36,4 @@ go.work.sum
# 本地配置文件
configs/local.yaml
configs/*.local.yaml
configs/*.local.yaml