11 Star 186 Fork 35

GVPHZWei/ZRouter

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
publish.sh 1.67 KB
一键复制 编辑 原始数据 按行查看 历史
HZWei 提交于 2025-10-26 23:30 +08:00 . feat(router): 新增根页面显示生命周期回调
#!/bin/bash
echo "start publish..."
# 加载配置
if [ -f "publish.config" ]; then
source publish.config
else
echo "错误: 找不到配置文件 publish.config"
exit 1
fi
echo "开始发布流程..."
# 检查har包是否存在
echo "检查har包..."
if ls ${HAR_FILE} 1> /dev/null 2>&1; then
echo "找到har包文件"
else
echo "错误: 未找到har包文件,请确认libs目录下存在har文件"
exit 1
fi
git config --global credential.helper store
# 发布har包
echo "开始发布har包..."
echo "ohpm版本: $(ohpm -v)"
PUBLISH_SUCCESS=false
for har_file in ${HAR_FILE}; do
if [ -f "$har_file" ]; then
echo "发布文件: $har_file"
# 使用 here-document 方式传递密码
ohpm publish "$har_file" << EOF
${OHPM_PASSWORD}
EOF
# 获取命令的退出状态码
ohpm_exit_code=$?
# 判断执行是否成功
if [ $ohpm_exit_code -eq 0 ]; then
PUBLISH_SUCCESS=true
echo "发布成功: $har_file"
else
echo "发布失败: $har_file (退出码: $ohpm_exit_code)"
# 退出脚本
exit 1
fi
fi
done
# 推送代码和tag
if [ "$ENABLE_GIT_OPERATIONS" = true ] && [ "$PUBLISH_SUCCESS" = true ]; then
# echo "提交代码..."
# git add .
# git commit -m "${COMMIT_MESSAGE}"
# 设置tag版本
echo "设置tag版本: ${TAG_VERSION}"
git tag -a "${TAG_VERSION}" -m "${COMMIT_MESSAGE}"
echo "推送代码和tag..."
git push origin main
git push origin "${TAG_NAME}"
git push github master
git push github "${TAG_NAME}"
else
echo "Git操作已禁用,跳过git提交和tag操作"
fi
echo "发布流程完成!"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/common-apps/ZRouter.git
git@gitee.com:common-apps/ZRouter.git
common-apps
ZRouter
ZRouter
main

搜索帮助