File tree Expand file tree Collapse file tree 2 files changed +57
-1
lines changed
Expand file tree Collapse file tree 2 files changed +57
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ Full example:
2424```
2525services:
2626 maxx:
27- image: ghcr.io/bowl42 /maxx:latest
27+ image: ghcr.io/awsl-project /maxx:latest
2828 container_name: maxx
2929 restart: unless-stopped
3030 ports:
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+
5+ # 获取参数
6+ if [ -z " $1 " ] || [ -z " $2 " ]; then
7+ echo " Usage: $0 <github_token> <version> [release_notes]"
8+ echo " Example: $0 ghp_xxxx v1.0.0 \" First release\" "
9+ exit 1
10+ fi
11+
12+ GITHUB_TOKEN=$1
13+ VERSION=$2
14+
15+ # 获取仓库信息
16+ REMOTE_URL=$( git config --get remote.origin.url)
17+ REPO=$( echo " $REMOTE_URL " | sed -n ' s|.*github.com[:/]\(.*\)\.git|\1|p' )
18+
19+ if [ -z " $REPO " ]; then
20+ echo " Error: 无法解析仓库信息"
21+ exit 1
22+ fi
23+
24+ echo " Creating tag: $VERSION "
25+ echo " Repository: $REPO "
26+
27+ # 创建并推送 tag
28+ git tag " $VERSION "
29+ git push origin " $VERSION "
30+
31+ echo " Tag $VERSION pushed successfully"
32+
33+ # 创建 GitHub Release
34+ echo " Creating GitHub Release..."
35+
36+ RESPONSE=$( curl -s -X POST \
37+ -H " Authorization: token $GITHUB_TOKEN " \
38+ -H " Accept: application/vnd.github.v3+json" \
39+ " https://api.github.com/repos/$REPO /releases" \
40+ -d " {
41+ \" tag_name\" : \" $VERSION \" ,
42+ \" name\" : \" $VERSION \" ,
43+ \" generate_release_notes\" : true,
44+ \" draft\" : false,
45+ \" prerelease\" : false
46+ }" )
47+
48+ # 检查是否成功
49+ if echo " $RESPONSE " | grep -q ' "id"' ; then
50+ RELEASE_URL=$( echo " $RESPONSE " | grep -o ' "html_url": "[^"]*"' | head -1 | cut -d' "' -f4)
51+ echo " Release created successfully: $RELEASE_URL "
52+ else
53+ echo " Error creating release:"
54+ echo " $RESPONSE "
55+ exit 1
56+ fi
You can’t perform that action at this time.
0 commit comments