Open source CapCut alternative.
TypeScript
ci: release on the [rebuild] label instead of a path list
David Le3e4eca114a69
diff --git a/.github/workflows/promote-donkey-release.yml b/.github/workflows/promote-donkey-release.ymlindex bb25c516..e68f037d 100644--- a/.github/workflows/promote-donkey-release.yml+++ b/.github/workflows/promote-donkey-release.yml@@ -1,29 +1,20 @@name: Release Donkeyon:- # Every push that changes code shipping inside the Mac app cuts a patch release.- # The path list mirrors the ` [rebuild]` commit-subject rule in CLAUDE.md: the Swift- # app, the Cut engine sources bun compiles into the bundled binary, and the packaging- # scripts. Site-only changes take no release.+ # A push cuts a patch release when it carries the ` [rebuild]` label — the+ # commit-subject rule in CLAUDE.md. Whether a change needs a new Mac app build is+ # the author's call, stated in the commit, rather than something inferred from the+ # paths it touched: the engine compiles a handful of shared modules that also serve+ # the hosted page, so a path list either releases site-only edits or misses app ones.+ # Every push runs the gate; only a labelled one reaches the build.#- # The tools recipe (tools/**, fetch-bundled-tools.sh) is deliberately absent. Those+ # The tools recipe (tools/**, fetch-bundled-tools.sh) goes the long way round. Those# changes go to Publish Bundled Tools first, which builds the new bundle, commits the# manifest pinning it, and then dispatches this workflow. Releasing on the recipe push# too would ship a build that still stages the previous bundle.push:branches:- main- paths:- - apps/**- - site/src/cut/engine/**- - site/src/cut/server/**- - site/src/cut/lib/**- - site/scripts/build-cut-engine.sh- - scripts/package-donkey-app.sh- - scripts/ensure-bundled-tools.sh- - scripts/sign-bundled-tools.sh- - scripts/promote-github-release.py- - .github/workflows/promote-donkey-release.ymlworkflow_dispatch:inputs:bump:@@ -88,6 +79,20 @@ jobs:fifi+ # A push ships only what asked to ship. The ` [rebuild]` label marks a commit+ # whose code goes inside the Mac app; with none since the last release there is+ # nothing new to build, and the appcast commit this workflow pushes itself is the+ # commonest such push. The whole range is read rather than the pushed commits, so+ # a labelled commit still ships when its own run is skipped or queued behind+ # another. A manual run bypasses the check: the run is the ask.+ if [[ "$GITHUB_EVENT_NAME" == "push" && "$should_release" == "true" ]]; then+ last_tag="$(git describe --tags --abbrev=0 --match 'v[0-9]*.[0-9]*.[0-9]*' HEAD 2>/dev/null || true)"+ if ! git log --format=%s "${last_tag:+$last_tag..}HEAD" | grep -qE '\[rebuild\][[:space:]]*$'; then+ should_release=false+ echo "::notice::No [rebuild] commit since ${last_tag:-the start of history}; skipping."+ fi+ fi+version="$(python3 - "$BUMP" <<'PY'from __future__ import annotationsdiff --git a/docs/guides/releasing-donkey.md b/docs/guides/releasing-donkey.mdindex 7d426bcb..2621e27b 100644--- a/docs/guides/releasing-donkey.md+++ b/docs/guides/releasing-donkey.md@@ -17,24 +17,35 @@ download URL and the appcast enclosure URL point at| | `Release Donkey` | `Nightly Donkey Build` ||---|---|---|-| Trigger | push to the default branch touching app code, or a bundled-tools republish — both always patch; plus manual: choose `patch`, `minor`, or `major` | nightly at 09:00 UTC, plus manual |+| Trigger | a ` [rebuild]` commit pushed to the default branch, or a bundled-tools republish — both always patch; plus manual: choose `patch`, `minor`, or `major` | nightly at 09:00 UTC, plus manual || Tag | numeric SemVer `vMAJOR.MINOR.PATCH` (starts at `0.1.0`) | moving `nightly` tag || Release | numeric GitHub Release, marked GitHub's latest | `Donkey Nightly Build` prerelease || Assets | `Donkey.dmg` + `Donkey.dmg.sha256` | `Donkey.dmg` + `Donkey.dmg.sha256` || Appcast / website | updates `site/public/appcast.xml` and the website download constant, commits both | untouched || Alias tags | moves `vMAJOR`, `vMAJOR.MINOR`, `latest` | untouched || Retention | keeps the latest 10 numeric releases; deletes older release records (never tags or the nightly prerelease) | n/a |-| Skip condition | a pushed commit that already carries a numeric release tag | skips when the `nightly` tag already points at the default-branch commit |+| Skip condition | no ` [rebuild]` commit since the last release, or a pushed commit that already carries a numeric release tag | skips when the `nightly` tag already points at the default-branch commit |Use nightly builds to smoke-test the latest default-branch app package. Use`Release Donkey` to publish a user-facing release.## What Triggers a Release-A push releases when it touches the Swift app, the Cut engine sources compiled-into the bundled binary, or the packaging scripts. Hosted site changes leave-the release alone. That path list is the same boundary as the ` [rebuild]`-commit-subject rule: a commit that needs a new Mac app build cuts a release.+The commit says so. A subject ending in ` [rebuild]` means the change ships+inside the Mac app — the Swift app, the Cut engine sources compiled into the+bundled binary, the packaging scripts — and a push carrying one cuts a release.+Anything else lands on the site alone and no build runs.++The label is the trigger rather than the paths a commit touched, because the+two aren't the same question. The engine compiles shared modules that also+serve the hosted page, so a path list either releases site-only edits or misses+app ones; whether a change needs to reach users' Macs is a judgement the author+already made.++The gate looks for the label anywhere between the last released tag and the+branch tip, not just in the commits of one push. A labelled commit that arrives+while another release is building, or whose own run is skipped, still ships on+the next push rather than waiting for someone to notice.The bundled tools take the long way round, because their recipe and the bundlethe app actually stages move at different times. A push to the tools recipe