From a0a4d31715e4fc0cce530b66c8fbc88ee1dbaef1 Mon Sep 17 00:00:00 2001 From: fujie Date: Tue, 6 Jan 2026 19:41:22 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20=E7=89=88=E6=9C=AC=E5=8F=B7?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E5=BD=93=E5=A4=A9=E5=8F=91=E5=B8=83=E6=AC=A1?= =?UTF-8?q?=E6=95=B0=E8=AE=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a13d64c..e107c2b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -180,14 +180,23 @@ jobs: - name: Determine version id: version + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ github.event.inputs.version }}" ]; then VERSION="${{ github.event.inputs.version }}" elif [[ "${{ github.ref }}" == refs/tags/v* ]]; then VERSION="${GITHUB_REF#refs/tags/}" else - # Auto-generate version based on date and run number - VERSION="v$(date +'%Y.%m.%d')-${{ github.run_number }}" + # Auto-generate version based on date and daily release count + TODAY=$(date +'%Y.%m.%d') + TODAY_PREFIX="v${TODAY}-" + + # Count existing releases with today's date prefix + EXISTING_COUNT=$(gh release list --limit 100 | grep -c "^${TODAY_PREFIX}" || echo "0") + NEXT_NUM=$((EXISTING_COUNT + 1)) + + VERSION="${TODAY_PREFIX}${NEXT_NUM}" fi echo "version=$VERSION" >> $GITHUB_OUTPUT echo "Release version: $VERSION"