From fd0f87fc6db695ff40efea249cc80ce7821dd4d0 Mon Sep 17 00:00:00 2001 From: merge-check <140916359+agentHits@users.noreply.github.com> Date: Tue, 27 Oct 2026 12:08:30 -0400 Subject: [PATCH] ci: cut one agenthits release per batch of merged PRs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Что: - agenthits-release.yml: каждый push в AgentHits-Dev, как и раньше, собирает образ (agenthits-dev, agenthits-dev-), а релиз agenthits-vX.Y.Z выходит только когда с прошлого релиза влито 20 PR (RELEASE_EVERY) или по ручному запуску workflow. - agenthits-next-release.sh: считает изменения с прошлого тега по first-parent; при push ниже порога отдаёт только сборку образа и пишет «N of 20» в summary; ручной запуск выпускает всё накопленное, заметки по-прежнему собирают все PR с прошлого тега. - agenthits-image.yml: комментарий о вызове без тега релиза. - CLAUDE.md: раздел Releases описывает выпуск версий пачками. Зачем: - Владелец просил одну версию на пачку изменений (примерно на 20 коммитов), а не новую версию на каждый влитый PR. Риски: - Между релизами панель показывает версию сборки как agenthits-vX.Y.Z-N-g: прошлый релиз плюс N коммитов. - Заметки большого релиза длинные: в них описания всех PR пачки. Проверки: - Скрипт прогнан локально на копии репозитория: push при 1 из 20 изменений отдаёт build=true без тега; ручной запуск и push при пороге 1 выпускают agenthits-v1.0.4 с заметками #91; bump=minor даёт v1.1.0; без новых коммитов build=false. - actionlint для agenthits-release.yml и agenthits-image.yml и shellcheck для скрипта — без замечаний. Co-Authored-By: Claude Opus 5.5 --- .github/scripts/agenthits-next-release.sh | 20 +++++++++++++++++++- .github/workflows/agenthits-image.yml | 3 ++- .github/workflows/agenthits-release.yml | 6 ++++++ CLAUDE.md | 2 +- 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/scripts/agenthits-next-release.sh b/.github/scripts/agenthits-next-release.sh index 240d277861f..f6e7c5ac494 100755 --- a/.github/scripts/agenthits-next-release.sh +++ b/.github/scripts/agenthits-next-release.sh @@ -4,12 +4,19 @@ # not only the PR of this push, keeps a change in the next release when a run # was dropped from the concurrency queue or failed before publishing. # +# The owner wants one version per batch of work, not one per merged PR: a push +# releases only once RELEASE_EVERY changes (first-parent commits, one per merged +# PR) have piled up since the previous tag, and earlier pushes get an image +# without a release. A manual run releases whatever is pending. +# # Outputs (GITHUB_OUTPUT): build, tag, previous, title, notes. set -euo pipefail : "${REPO:?REPO (owner/name) is required}" : "${GITHUB_OUTPUT:?}" bump="${BUMP:-auto}" +event="${EVENT:-push}" +release_every="${RELEASE_EVERY:-20}" base_branch="${BASE_BRANCH:-AgentHits-Dev}" image="${IMAGE:-ghcr.io/agenthits/dokploy}" work_dir="$(mktemp -d)" @@ -23,12 +30,23 @@ if [ -z "$previous" ]; then exit 0 fi -if [ "$(git rev-list --count "${previous}..HEAD")" = 0 ]; then +pending="$(git rev-list --count --first-parent "${previous}..HEAD")" +if [ "$pending" = 0 ]; then echo "Nothing to release: HEAD has no commits after ${previous}." echo "build=false" >>"$GITHUB_OUTPUT" exit 0 fi +if [ "$event" = push ] && [ "$pending" -lt "$release_every" ]; then + waiting="${pending} of ${release_every} changes since ${previous}: image only, the release waits for a full batch or a manual run." + echo "$waiting" + if [ -n "${GITHUB_STEP_SUMMARY:-}" ]; then + echo "$waiting" >>"$GITHUB_STEP_SUMMARY" + fi + echo "build=true" >>"$GITHUB_OUTPUT" + exit 0 +fi + : >"${work_dir}/prs.jsonl" : >"${work_dir}/direct.jsonl" while read -r sha; do diff --git a/.github/workflows/agenthits-image.yml b/.github/workflows/agenthits-image.yml index e59456ad76b..0335e11cc02 100644 --- a/.github/workflows/agenthits-image.yml +++ b/.github/workflows/agenthits-image.yml @@ -1,7 +1,8 @@ name: AgentHits Dokploy Image # Pushes to AgentHits-Dev build through agenthits-release.yml, which calls this -# workflow with the release tag. A manual run builds the selected branch, or, +# workflow with a release tag when the push completes a batch and without one +# otherwise. A manual run builds the selected branch, or, # with release-tag set to a published release, rebuilds that release's image. on: workflow_call: diff --git a/.github/workflows/agenthits-release.yml b/.github/workflows/agenthits-release.yml index 52ecdbd5636..10e1fbd9efd 100644 --- a/.github/workflows/agenthits-release.yml +++ b/.github/workflows/agenthits-release.yml @@ -14,6 +14,11 @@ on: permissions: contents: read +# Every push builds the image; a push cuts a release only once this many PRs +# have been merged since the previous one (see agenthits-next-release.sh). +env: + RELEASE_EVERY: 20 + # The next version is counted from the newest tag, so runs must not overlap. # A queued run that GitHub replaces loses nothing: the next run collects every # PR merged since the newest tag. @@ -44,6 +49,7 @@ jobs: GH_TOKEN: ${{ github.token }} REPO: ${{ github.repository }} BUMP: ${{ inputs.bump || 'auto' }} + EVENT: ${{ github.event_name }} run: bash .github/scripts/agenthits-next-release.sh image: diff --git a/CLAUDE.md b/CLAUDE.md index e9f4bfa0094..9b2cc91aa21 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -15,7 +15,7 @@ Every pull request targets `AgentHits-Dev`, including a PR that builds on anothe ## Releases -Every push to `AgentHits-Dev` (every merged PR) gets a GitHub release `agenthits-vX.Y.Z` from `.github/workflows/agenthits-release.yml`. The `agenthits-` prefix keeps fork tags apart from upstream Dokploy `v0.x` tags. The version goes up by patch, by minor when a merged PR title starts with `feat`, and by major only through a manual run with `bump: major`. The release notes are the merged PR's title and body, so write the PR description for someone reading the release. The image of a release is `ghcr.io/agenthits/dokploy:agenthits-vX.Y.Z` and panels show that tag as the fork version; `agenthits-dev` always points at the newest build. `.github/workflows/agenthits-ghcr-retention.yml` deletes old GHCR versions weekly but never a release tag, `agenthits-dev` or `buildcache`. +One GitHub release `agenthits-vX.Y.Z` covers a batch of work, not a single PR (owner's decision 2026-10-27). Every push to `AgentHits-Dev` builds the image through `.github/workflows/agenthits-release.yml` (`agenthits-dev`, `agenthits-dev-`), and panels show such a build as `agenthits-vX.Y.Z-N-g`: the previous release plus N commits. A push cuts the release once 20 PRs (`RELEASE_EVERY`, first-parent commits) have been merged since the previous release; to release a finished batch sooner, run `gh workflow run agenthits-release.yml --repo TaskFlow-Systems/dokploy --ref AgentHits-Dev`. Several PRs that belong together can also be merged as one combined PR. The `agenthits-` prefix keeps fork tags apart from upstream Dokploy `v0.x` tags. The version goes up by patch, by minor when a PR title in the batch starts with `feat`, and by major only through a manual run with `bump: major`. The release notes are the title and body of every PR merged since the previous release, so write each PR description for someone reading the release. The image of a release is `ghcr.io/agenthits/dokploy:agenthits-vX.Y.Z` and panels show that tag as the fork version; `agenthits-dev` always points at the newest build. `.github/workflows/agenthits-ghcr-retention.yml` deletes old GHCR versions weekly but never a release tag, `agenthits-dev` or `buildcache`. ## Dependencies