From 71507374cadbf3dd583b55d6f6a63b839414f38a Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Sun, 12 Jul 2026 01:23:56 +0900 Subject: [PATCH] fix: Reset release sequence number to 0 on each new date Per spec: the sequence number is a per-day counter that resets on date change and starts at 0, not 1. The first release of a day is quant_YYYYMMDD.0.hash, the second .1, etc. Previous commit fixed *counting* today's releases via the Gitea API (instead of the always-empty local git tags from a shallow checkout), but still added +1 on top, which would have produced 1, 2, 3... for the first, second, third releases of a day instead of 0, 1, 2. DEPLOY_COUNT is now just RELEASES_TODAY directly. --- .gitea/workflows/prepare-release.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/prepare-release.yml b/.gitea/workflows/prepare-release.yml index 6608b0ec..a9631fcd 100644 --- a/.gitea/workflows/prepare-release.yml +++ b/.gitea/workflows/prepare-release.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: version: - description: 'Release version (auto-generated if empty, e.g. quant_20260711.1.abc1234)' + description: 'Release version (auto-generated if empty, e.g. quant_20260711.0.abc1234 for the first deploy that day)' required: false type: string @@ -49,11 +49,13 @@ jobs: # "quant_20260711.1.*" (three of them: b7591fb, 6ab270f, # e49922e, all claiming to be deploy #1). Query the actual # Gitea Releases API instead, which reflects real state. + # Sequence number resets to 0 on each new date -- the first + # release of a day is quant_YYYYMMDD.0.hash, the second .1, etc. RELEASES_TODAY=$(curl -sf --connect-timeout 10 --max-time 30 \ -H "Authorization: token ${GITEA_TOKEN}" \ "https://gitea.taxbaik.com/api/v1/repos/${{ github.repository }}/tags?limit=50" \ | jq -r --arg prefix "quant_${TODAY}." '[.[] | select(.name | startswith($prefix))] | length') - DEPLOY_COUNT=$((RELEASES_TODAY + 1)) + DEPLOY_COUNT=$RELEASES_TODAY VERSION="quant_${TODAY}.${DEPLOY_COUNT}.${COMMIT}" else