From e041240423dce488c13d2328a22dcab0988a24c3 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 10 Mar 2026 23:11:17 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=E9=80=BB=E8=BE=91=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=9D=A1=E4=BB=B6=E5=88=A4=E6=96=AD=E4=BB=A5=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E4=BD=9C=E4=B8=9A=E6=89=A7=E8=A1=8C=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E7=89=88=E6=9C=AC=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7da45e03..d3ff70ca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,6 +12,7 @@ jobs: prepare: runs-on: ubuntu-latest outputs: + should_run: ${{ steps.version.outputs.should_run }} version: ${{ steps.version.outputs.version }} is_prerelease: ${{ steps.version.outputs.is_prerelease }} steps: @@ -23,11 +24,19 @@ jobs: - name: Resolve version metadata id: version run: | - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + SHOULD_RUN=true + POINTED_TAG="$(git tag --points-at HEAD --list 'v*' | sort -V | tail -n1)" + + if [[ "${GITHUB_REF}" == refs/heads/main ]] && [[ -n "$POINTED_TAG" ]]; then + SHOULD_RUN=false + VERSION="$POINTED_TAG" + elif [[ "${GITHUB_REF}" == refs/tags/* ]]; then VERSION="${GITHUB_REF_NAME}" else VERSION="$(git describe --tags)" fi + + echo "should_run=$SHOULD_RUN" >> "$GITHUB_OUTPUT" echo "version=$VERSION" >> "$GITHUB_OUTPUT" if [[ "$VERSION" =~ ^v[0-9]+(\.[0-9]+)*$ ]]; then echo "is_prerelease=false" >> "$GITHUB_OUTPUT" @@ -37,6 +46,7 @@ jobs: build-frontend: needs: prepare + if: needs.prepare.outputs.should_run == 'true' runs-on: ubuntu-latest steps: - name: Checkout @@ -69,6 +79,7 @@ jobs: needs: - prepare - build-frontend + if: needs.prepare.outputs.should_run == 'true' runs-on: ubuntu-latest strategy: fail-fast: false @@ -129,6 +140,7 @@ jobs: build-agent-binaries: needs: prepare + if: needs.prepare.outputs.should_run == 'true' runs-on: ubuntu-latest strategy: fail-fast: false @@ -186,12 +198,20 @@ jobs: - prepare - build-binaries - build-agent-binaries + if: needs.prepare.outputs.should_run == 'true' runs-on: ubuntu-latest steps: - - name: Download Binary Artifacts + - name: Download Server Artifacts uses: actions/download-artifact@v4 with: - pattern: "*-*" + pattern: "server-*" + path: dist + merge-multiple: true + + - name: Download Agent Artifacts + uses: actions/download-artifact@v4 + with: + pattern: "agent-*" path: dist merge-multiple: true