mirror of
https://github.com/babalae/bettergi-scripts-list.git
synced 2026-03-16 03:33:25 +08:00
美化输出
This commit is contained in:
45
.github/workflows/build_release_branch.yml
vendored
45
.github/workflows/build_release_branch.yml
vendored
@@ -16,53 +16,74 @@ jobs:
|
||||
actions: read
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
- name: 📥 检出代码仓库
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: bettergi-scripts-list
|
||||
|
||||
- name: Setup Node.js
|
||||
- name: 🚀 配置 Node.js 环境
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '22'
|
||||
|
||||
- name: Build project
|
||||
- name: 🔨 构建项目并生成文件
|
||||
run: |
|
||||
echo "🔄 开始构建项目..."
|
||||
cd bettergi-scripts-list
|
||||
echo "📦 执行构建脚本 (强制模式 + Gzip压缩)"
|
||||
node ./build/build.js --force --gzip
|
||||
echo "✅ 项目构建完成"
|
||||
|
||||
- name: Copy generated files
|
||||
- name: 📋 复制生成的文件到工作目录
|
||||
run: |
|
||||
echo "📂 复制 repo.json 和 repo.json.gz 文件..."
|
||||
cp bettergi-scripts-list/repo.json .
|
||||
cp bettergi-scripts-list/repo.json.gz .
|
||||
echo "✅ 文件复制完成"
|
||||
ls -la *.json*
|
||||
|
||||
- name: Discard changes in bettergi-scripts-list
|
||||
- name: 🧹 清理工作目录变更
|
||||
run: |
|
||||
echo "🔄 清理 bettergi-scripts-list 目录中的变更..."
|
||||
cd bettergi-scripts-list
|
||||
git checkout -- .
|
||||
git clean -fd
|
||||
echo "✅ 工作目录清理完成"
|
||||
|
||||
- name: Reset and switch to release branch
|
||||
- name: ⚙️ 配置 Git 用户信息
|
||||
run: |
|
||||
echo "🔧 配置 Git 用户身份信息..."
|
||||
cd bettergi-scripts-list
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
echo "✅ Git 用户信息配置完成"
|
||||
|
||||
- name: 🌿 准备 Release 分支
|
||||
run: |
|
||||
echo "🔄 开始准备 Release 分支..."
|
||||
cd bettergi-scripts-list
|
||||
|
||||
# 删除本地release分支(如果存在)
|
||||
echo "🗑️ 删除本地 release 分支(如果存在)"
|
||||
git branch -D release || true
|
||||
|
||||
# 创建新的orphan分支
|
||||
echo "🆕 创建新的 orphan 分支"
|
||||
git checkout --orphan release
|
||||
|
||||
# 将main分支的内容检出到工作区
|
||||
echo "📦 检出 main 分支的内容到工作区"
|
||||
git checkout main -- repo .gitignore
|
||||
|
||||
# 复制生成好的repo.json文件
|
||||
echo "📋 复制生成的文件到 release 分支"
|
||||
cp ../repo.json .
|
||||
cp ../repo.json.gz .
|
||||
|
||||
echo "📊 显示当前文件状态"
|
||||
ls -la
|
||||
echo "✅ Release 分支准备完成"
|
||||
|
||||
- name: Commit and push to release branch
|
||||
- name: 🚀 提交并推送到 Release 分支
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: "reset the release branch"
|
||||
commit_message: "🔄 重置 release 分支 - 自动构建于 $(date '+%Y-%m-%d %H:%M:%S')"
|
||||
branch: release
|
||||
push_options: '--force'
|
||||
repository: bettergi-scripts-list
|
||||
Reference in New Issue
Block a user