feat: 在 trigger-version GitHub Action 中添加 use-latest-version 输入参数,支持在非版本触发时使用当前分支最新的版本标签,同时更新版本号输出格式,新增横线格式版本号的生成,更新文档以反映新功能和使用示例。

This commit is contained in:
Lyda
2025-08-21 11:05:24 +08:00
parent 8c5ff61828
commit 52eb45b66f
4 changed files with 82 additions and 11 deletions

View File

@@ -14,6 +14,7 @@ jobs:
outputs:
is-version-trigger: ${{ steps.version-info.outputs.is-version-trigger }}
trigger-version: ${{ steps.version-info.outputs.trigger-version }}
version-with-dash: ${{ steps.version-info.outputs.version-with-dash }}
trigger-source: ${{ steps.version-info.outputs.trigger-source }}
ref-name: ${{ steps.version-info.outputs.ref-name }}
deploy-staging: ${{ steps.deployment-strategy.outputs.deploy-staging }}
@@ -102,8 +103,11 @@ jobs:
- name: 部署到生产环境
run: |
echo "🚀 部署版本 ${{ needs.analyze.outputs.trigger-version }} 到生产环境"
echo "🐳 Docker标签: myapp:${{ needs.analyze.outputs.version-with-dash }}"
echo "触发源: ${{ needs.analyze.outputs.trigger-source }}"
# 生产部署逻辑
# docker build -t myapp:${{ needs.analyze.outputs.version-with-dash }} .
# docker push myapp:${{ needs.analyze.outputs.version-with-dash }}
echo "✅ 生产环境部署完成"
- name: 创建 Release