Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .github/scripts/agenthits-next-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/agenthits-image.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/agenthits-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-<sha12>`), and panels show such a build as `agenthits-vX.Y.Z-N-g<sha12>`: 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

Expand Down