mirror of
https://git.bjxgj.com/xgj/xgj-actions.git
synced 2025-10-14 16:53:37 +08:00
chore: 更新 Web 项目发布构建的 GitHub Action,移除不必要的输入参数,简化参数验证步骤,优化文档描述,增强环境变量支持,提升可读性和灵活性。
This commit is contained in:
@@ -7,18 +7,8 @@ branding:
|
||||
color: 'green'
|
||||
|
||||
inputs:
|
||||
gitea-token:
|
||||
description: 'Gitea访问令牌'
|
||||
required: true
|
||||
|
||||
app-env:
|
||||
description: '应用环境 (development, production等)'
|
||||
required: false
|
||||
default: 'production'
|
||||
|
||||
|
||||
release-command:
|
||||
description: '发布命令,默认为 npm run release -- --release -V'
|
||||
description: '发布命令,例如 npm run release -- --release -V'
|
||||
required: false
|
||||
default: 'npm run release -- --release -V'
|
||||
|
||||
@@ -39,18 +29,6 @@ outputs:
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: 验证必需参数
|
||||
shell: bash
|
||||
run: |
|
||||
echo "🔍 验证输入参数..."
|
||||
|
||||
if [[ -z "${{ inputs.gitea-token }}" ]]; then
|
||||
echo "❌ 错误: gitea-token 参数是必需的"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ 参数验证通过"
|
||||
|
||||
- name: 发布构建
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -60,8 +38,6 @@ runs:
|
||||
echo "✅ 发布构建完成"
|
||||
env:
|
||||
NODE_DEBUG: ${{ inputs.node-debug == 'true' && 'release-it:*' || '' }}
|
||||
GITEA_TOKEN: ${{ inputs.gitea-token }}
|
||||
APP_ENV: ${{ inputs.app-env }}
|
||||
|
||||
- name: 获取版本信息
|
||||
id: get_var
|
||||
@@ -91,4 +67,3 @@ runs:
|
||||
echo ""
|
||||
echo "📋 发布信息:"
|
||||
echo " - 版本号: ${{ steps.get_var.outputs.version }}"
|
||||
echo " - 应用环境: ${{ inputs.app-env }}"
|
||||
|
Reference in New Issue
Block a user