Skip to content

Commit 03bc06e

Browse files
committed
breaking change ?!
1 parent 68bb5c1 commit 03bc06e

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

.github/workflows/create-git-branch-package-on-release.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ jobs:
3939
git config --global user.email "github-actions[bot]@users.noreply.github.com"
4040
4141
# 关键修复:将git@github.com格式的URL转换为https格式并使用令牌
42-
git config --global url."https://x-access-token:${{ secrets.BOT_TOKEN }}@github.com/".insteadOf "git@github.com:"
43-
# git config --global url."https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/".insteadOf "git@github.com:"
42+
# git config --global url."https://x-access-token:${{ secrets.BOT_TOKEN }}@github.com/".insteadOf "git@github.com:"
43+
git config --global url."https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/".insteadOf "git@github.com:"
4444
4545
# 修改.gitmodules文件以使用HTTPS URL
4646
if [ -f .gitmodules ]; then
@@ -75,9 +75,6 @@ jobs:
7575
fi
7676
7777
- name: Create custom source code packages
78-
# env:
79-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80-
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8178
run: |
8279
PROJECT_NAME="${{ github.event.repository.name }}"
8380
echo "Project name: $PROJECT_NAME"
@@ -99,15 +96,19 @@ jobs:
9996
10097
mkdir -p temp-package
10198
102-
echo "Cloning single branch with full history..."
103-
# REPO_URL="https://github.com/${{ github.repository }}.git"
104-
REPO_URL="https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git"
105-
106-
# git clone --single-branch --branch "$CURRENT_BRANCH" "$REPO_URL" temp-package/$PROJECT_NAME-${{ env.TAG_VERSION }}
107-
gh repo clone ${{ github.repository }} temp-package/$PROJECT_NAME-${{ env.TAG_VERSION }} -- --single-branch --branch "$CURRENT_BRANCH"
99+
# 不使用 gh repo clone,而是直接复制已经克隆好的仓库(包括子模块)
100+
echo "复制已克隆的仓库(包含子模块)..."
101+
cp -r $(pwd) temp-package/$PROJECT_NAME-${{ env.TAG_VERSION }}
108102
109103
cd temp-package/$PROJECT_NAME-${{ env.TAG_VERSION }}
110104
105+
# 检查子模块目录内容
106+
echo "检查子模块目录内容:"
107+
find . -type d -name "protocol-enterprise" -exec ls -la {} \; || echo "找不到子模块目录"
108+
109+
# # 移除 .git 目录但保留 .git 文件(这样可以保留 Git 仓库状态而不包含完整历史)
110+
# find . -name ".git" -type d | grep -v "^./.git$" | xargs rm -rf
111+
111112
git config user.name "github-actions[bot]"
112113
git config user.email "github-actions[bot]@users.noreply.github.com"
113114
@@ -131,22 +132,21 @@ jobs:
131132
git log --oneline -5 2>/dev/null || echo "No git history found"
132133
git remote -v 2>/dev/null || echo "No remotes found"
133134
135+
# 显示子模块内容以确认存在
136+
echo "子模块目录内容:"
137+
find . -type d -name "protocol-enterprise" -exec ls -la {} \; || echo "找不到子模块目录"
138+
134139
cd ..
135140
136141
zip -r ../$PROJECT_NAME-${{ env.TAG_VERSION }}-with-git.zip $PROJECT_NAME-${{ env.TAG_VERSION }}/
137142
tar -czf ../$PROJECT_NAME-${{ env.TAG_VERSION }}-with-git.tar.gz $PROJECT_NAME-${{ env.TAG_VERSION }}/
138143
139-
# cd ..
140-
141-
# echo "Created files:"
142-
# ls -la $PROJECT_NAME-${{ env.TAG_VERSION }}-with-git.*
143-
# echo "File sizes:"
144-
# du -h $PROJECT_NAME-${{ env.TAG_VERSION }}-with-git.*
144+
cd ..
145+
echo "创建的文件大小:"
146+
du -h $PROJECT_NAME-${{ env.TAG_VERSION }}-with-git.*
145147
146-
# echo "ZIP contents (first 20 lines):"
147-
# unzip -l $PROJECT_NAME-${{ env.TAG_VERSION }}-with-git.zip | head -20
148-
# echo "TAR.GZ contents (first 20 lines):"
149-
# tar -tzf $PROJECT_NAME-${{ env.TAG_VERSION }}-with-git.tar.gz | head -20
148+
echo "打包文件内容概览:"
149+
unzip -l $PROJECT_NAME-${{ env.TAG_VERSION }}-with-git.zip | grep protocol-enterprise | head -10
150150
151151
- name: Upload custom source packages to existing release
152152
uses: softprops/action-gh-release@v2

0 commit comments

Comments
 (0)