From 9dbdfaee941b43f822bfec00d2302d5498d21b6b Mon Sep 17 00:00:00 2001 From: Hommy <16620803786@163.com> Date: Fri, 3 Jul 2026 14:57:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=93=E5=8C=85=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E4=BB=85=E5=BD=93desktop-client=E4=B8=8B?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=E6=96=87=E4=BB=B6=E6=9C=89=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=97=B6=E6=89=8D=E8=BF=9B=E8=A1=8C=E6=89=93=E5=8C=85=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/desktop-client-dev.yml | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/desktop-client-dev.yml b/.github/workflows/desktop-client-dev.yml index aad67e2..afcddcb 100644 --- a/.github/workflows/desktop-client-dev.yml +++ b/.github/workflows/desktop-client-dev.yml @@ -6,7 +6,37 @@ on: - 'v*' # 仅在推送 v 开头的 tag 时触发打包 jobs: + check-changes: + runs-on: ubuntu-latest + outputs: + changed: ${{ steps.check.outputs.changed }} + steps: + - name: 准备代码 + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: 检查 desktop-client 是否有变更 + id: check + run: | + CURRENT_TAG="${{ github.ref_name }}" + PREV_TAG=$(git tag -l 'v*' --sort=-v:refname | grep -Fxv "$CURRENT_TAG" | head -1) + if [ -n "$PREV_TAG" ]; then + BASE="$PREV_TAG" + else + BASE=$(git rev-list --max-parents=0 HEAD) + fi + if git diff --name-only "$BASE" "${{ github.sha }}" | grep -q '^desktop-client/'; then + echo "changed=true" >> "$GITHUB_OUTPUT" + echo "desktop-client 目录存在变更 (${BASE}..${{ github.sha }}),继续打包" + else + echo "changed=false" >> "$GITHUB_OUTPUT" + echo "desktop-client 目录无变更,跳过打包" + fi + build: + needs: check-changes + if: needs.check-changes.outputs.changed == 'true' runs-on: ${{ matrix.os }} strategy: