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