From 0deeb4aaf7b3c21e8620f5bc6c58730edd2ce802 Mon Sep 17 00:00:00 2001 From: KenGrofork <126143068+KenGrofork@users.noreply.github.com> Date: Thu, 4 Jul 2024 16:02:36 +0800 Subject: [PATCH 1/2] fix:Optimize triggering workflow methods and default parameters Avoid frequent triggering and add default values to the workflow --- .github/workflows/Build-WeChatFerry.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Build-WeChatFerry.yml b/.github/workflows/Build-WeChatFerry.yml index ab00da7..9945171 100644 --- a/.github/workflows/Build-WeChatFerry.yml +++ b/.github/workflows/Build-WeChatFerry.yml @@ -2,9 +2,15 @@ name: Build-WeChatFerry on: push: - branches: [master] + branches: + - master + paths: + - 'WeChatFerry/**' # 仅当这个目录中的文件有变化时触发 pull_request: - branches: [master] + branches: + - master + paths: + - 'WeChatFerry/**' workflow_dispatch: inputs: use_cache: @@ -29,7 +35,12 @@ jobs: steps: - name: 检出代码 uses: actions/checkout@v4 - + + - name: 设置默认值 + run: | + echo "USE_CACHE=${{ github.event.inputs.use_cache || 'yes' }}" >> $GITHUB_ENV + echo "BUILD_CONFIGS=${{ github.event.inputs.build_configurations || 'Release,Debug' }}" >> $GITHUB_ENV + - name: 获取版本号和微信版本号 run: | $version = (Select-String -Path "WeChatFerry/spy/spy.rc" -Pattern 'VALUE "FileVersion", "(.*)"').Matches.Groups[1].Value.Trim() From c66480dab4ca5a8198e52f96ed26b851ac15994b Mon Sep 17 00:00:00 2001 From: KenGrofork <126143068+KenGrofork@users.noreply.github.com> Date: Thu, 4 Jul 2024 16:38:31 +0800 Subject: [PATCH 2/2] Optimize trigger process When you push tags that match the regular expression v[0-9]+.[0-9]+.[0-9]+, the trigger will occur. --- .github/workflows/Build-WeChatFerry.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/Build-WeChatFerry.yml b/.github/workflows/Build-WeChatFerry.yml index 9945171..f032095 100644 --- a/.github/workflows/Build-WeChatFerry.yml +++ b/.github/workflows/Build-WeChatFerry.yml @@ -2,15 +2,8 @@ name: Build-WeChatFerry on: push: - branches: - - master - paths: - - 'WeChatFerry/**' # 仅当这个目录中的文件有变化时触发 - pull_request: - branches: - - master - paths: - - 'WeChatFerry/**' + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' workflow_dispatch: inputs: use_cache: