Compare commits
2 Commits
v1.0.0-bet
...
v1.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
| 21e4710829 | |||
| 0b102dcb2a |
@@ -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
4
.gitignore
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user