Compare commits
2 Commits
v1.0.0-bet
...
21e4710829
| Author | SHA1 | Date | |
|---|---|---|---|
| 21e4710829 | |||
| 0b102dcb2a |
@@ -41,17 +41,20 @@ jobs:
|
|||||||
GITEA_TOKEN: ${{ secrets.release_token }}
|
GITEA_TOKEN: ${{ secrets.release_token }}
|
||||||
run: |
|
run: |
|
||||||
apk add curl
|
apk add curl
|
||||||
|
|
||||||
TAG_NAME="${GITHUB_REF#refs/tags/}"
|
TAG_NAME="${GITHUB_REF#refs/tags/}"
|
||||||
|
|
||||||
# 创建 Release
|
# 创建 Release 并获取 release_id
|
||||||
curl -s -X POST "https://hub.gaomia.site/api/v1/repos/titor/yoyo/releases" \
|
RELEASE_RESPONSE=$(curl -s -X POST "https://hub.gaomia.site/api/v1/repos/titor/yoyo/releases" \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-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
|
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}" \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
-F "attachment=@$f"
|
-F "attachment=@$f"
|
||||||
done
|
done
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -5,6 +5,7 @@ yoyo
|
|||||||
*.dll
|
*.dll
|
||||||
*.so
|
*.so
|
||||||
*.dylib
|
*.dylib
|
||||||
|
yoo
|
||||||
|
|
||||||
# 测试
|
# 测试
|
||||||
*.test
|
*.test
|
||||||
@@ -27,6 +28,7 @@ vendor/
|
|||||||
# 构建输出
|
# 构建输出
|
||||||
dist/
|
dist/
|
||||||
build/
|
build/
|
||||||
|
project/
|
||||||
|
|
||||||
# Go工作区
|
# Go工作区
|
||||||
go.work
|
go.work
|
||||||
@@ -34,4 +36,4 @@ go.work.sum
|
|||||||
|
|
||||||
# 本地配置文件
|
# 本地配置文件
|
||||||
configs/local.yaml
|
configs/local.yaml
|
||||||
configs/*.local.yaml
|
configs/*.local.yaml
|
||||||
|
|||||||
Reference in New Issue
Block a user