🔧 chore(scripts): 更新发布脚本中的远程仓库引用
Some checks failed
Virtual Kubelet Docker Build and Deploy / build-and-deploy (push) Has been cancelled
Some checks failed
Virtual Kubelet Docker Build and Deploy / build-and-deploy (push) Has been cancelled
- 将硬编码的远程仓库名称从 'gitea' 更改为 'origin' 以提升通用性 - 更新标签获取、代码拉取、标签推送和构建进度链接中的远程引用 - 确保脚本在不同仓库配置下都能正常工作
This commit is contained in:
10
scripts/release.sh
Normal file → Executable file
10
scripts/release.sh
Normal file → Executable file
@@ -15,7 +15,7 @@ if [ $# -eq 0 ]; then
|
||||
echo ""
|
||||
echo "📋 Gitea 最近10个标签:"
|
||||
# 尝试获取远程标签,如果失败则使用本地标签
|
||||
REMOTE_TAGS=$(git ls-remote --tags gitea 2>/dev/null | grep -v "\^{}" | cut -f 2 | sed 's|refs/tags/||')
|
||||
REMOTE_TAGS=$(git ls-remote --tags origin 2>/dev/null | grep -v "\^{}" | cut -f 2 | sed 's|refs/tags/||')
|
||||
if [ -z "$REMOTE_TAGS" ]; then
|
||||
echo "⚠️ 无法获取远程标签,显示本地最近10个标签:"
|
||||
git tag --list | sort -V | tail -10
|
||||
@@ -29,7 +29,7 @@ fi
|
||||
if [ "$1" = "--list" ] || [ "$1" = "-l" ]; then
|
||||
echo "📋 Gitea 所有标签:"
|
||||
# 尝试获取远程标签,如果失败则使用本地标签
|
||||
REMOTE_TAGS=$(git ls-remote --tags gitea 2>/dev/null | grep -v "\^{}" | cut -f 2 | sed 's|refs/tags/||')
|
||||
REMOTE_TAGS=$(git ls-remote --tags origin 2>/dev/null | grep -v "\^{}" | cut -f 2 | sed 's|refs/tags/||')
|
||||
if [ -z "$REMOTE_TAGS" ]; then
|
||||
echo "⚠️ 无法获取远程标签,显示本地标签:"
|
||||
git tag --list | sort -V
|
||||
@@ -68,7 +68,7 @@ echo "🌿 当前分支: $CURRENT_BRANCH"
|
||||
|
||||
# 拉取最新代码
|
||||
echo "📥 拉取最新代码..."
|
||||
git pull gitea "$CURRENT_BRANCH"
|
||||
git pull origin "$CURRENT_BRANCH"
|
||||
|
||||
|
||||
# 创建标签
|
||||
@@ -77,7 +77,7 @@ git tag "$TAG"
|
||||
|
||||
# 推送标签
|
||||
echo "📤 推送标签到远程仓库..."
|
||||
git push gitea "$TAG"
|
||||
git push origin "$TAG"
|
||||
|
||||
echo ""
|
||||
echo "🎉 发布流程已启动!"
|
||||
@@ -85,4 +85,4 @@ echo "📋 版本: $VERSION"
|
||||
echo "🏷️ 标签: $TAG"
|
||||
echo "🔗 GitHub Actions 将自动构建和发布 Docker 镜像"
|
||||
echo ""
|
||||
echo "📊 查看构建进度: $(git config --get remote.gitea.url | sed 's|^ssh://||' | sed 's|^git@||' | sed 's|:|/|' | sed 's|\.git$||')/actions"
|
||||
echo "📊 查看构建进度: $(git config --get remote.origin.url | sed 's|^ssh://||' | sed 's|^git@||' | sed 's|:|/|' | sed 's|\.git$||')/actions"
|
||||
Reference in New Issue
Block a user