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
18 changes: 15 additions & 3 deletions .github/workflows/sync-whisper-transcriber.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,12 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
branch="chore/whisper-transcriber-${TAG}"
# One rolling branch rather than one per release. The source
# repository now publishes on every merge, so a branch per tag would
# leave a queue of near-identical pull requests, each superseded by
# the next. This branch always carries the newest artifact that has
# not been merged yet, and its pull request is updated in place.
branch="chore/whisper-transcriber-sync"
build_id="$(node -p "require('./static/utility-apps/whisper-transcriber/manifest.json').buildId")"
version="$(node -p "require('./static/utility-apps/whisper-transcriber/manifest.json').version")"

Expand All @@ -139,7 +144,11 @@ jobs:
git add static/utility-apps/whisper-transcriber
git commit -F commit-msg.md
rm -f commit-msg.md
git push --force-with-lease origin "$branch"
# Plain --force on purpose. The branch is rebuilt from main on every
# run and is owned by this workflow, so there is nothing to preserve;
# --force-with-lease would fail outright here, because a freshly
# created local branch has no remote-tracking ref to compare against.
git push --force origin "$branch"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject stale releases before force-pushing the rolling branch

When an older dispatch runs after a newer one (for example, a delayed source release event or a manual workflow_dispatch for an earlier tag), this unconditional push to the single rolling branch rewrites the existing PR back to that older artifact because the workflow never compares TAG/manifest buildTime with what is already on the PR. The previous per-tag branches could not replace a newer PR this way, but now the last completed run always wins, so a stale artifact can be presented and merged as the latest unless older releases are skipped before updating the branch.

Useful? React with 👍 / 👎.


{
printf 'Republishes the embedded Whisper Transcriber from [%s@%s](https://github.com/%s/releases/tag/%s).\n\n' \
Expand All @@ -156,7 +165,10 @@ jobs:

existing="$(gh pr list --head "$branch" --state open --json number --jq '.[0].number // empty')"
if [ -n "$existing" ]; then
gh pr edit "$existing" --body-file pr-body.md
# Title too, not just the body: the open pull request now stands for
# whichever release is newest, not the one that first opened it.
gh pr edit "$existing" \
--title "Publish Whisper Transcriber ${TAG}" --body-file pr-body.md
echo "Updated existing pull request #${existing}"
else
gh pr create --base main --head "$branch" \
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,16 +338,19 @@ Utilities too heavy to live in the Docusaurus bundle are built elsewhere and
published here as static artifacts. The Whisper Transcriber is the reference
implementation of that pipeline:

1. Tagging a release in [`YurMil/ws-speech-text`](https://github.com/YurMil/ws-speech-text)
builds the bundle, audits it, and attaches a checksummed archive to a GitHub
release.
1. Merging application code to `main` in
[`YurMil/ws-speech-text`](https://github.com/YurMil/ws-speech-text) builds the
bundle, tests and audits it, and attaches a checksummed archive to a GitHub
release. (Documentation-only merges there do not release.)
2. That workflow sends a `whisper-transcriber-release` `repository_dispatch` here
(secret `SITE_DISPATCH_TOKEN`, set in the source repository).
3. `.github/workflows/sync-whisper-transcriber.yml` downloads the archive,
refuses it unless the SHA-256 matches, republishes
`static/utility-apps/whisper-transcriber/` via
`scripts/sync-whisper-transcriber.mjs`, runs typecheck/lint/build, and opens
a pull request.
a pull request on the rolling `chore/whisper-transcriber-sync` branch —
updated in place, so successive releases never queue up as separate pull
requests.

Nothing is deployed without review, and this repository never builds the app or
downloads model weights. The same script publishes from a local checkout during
Expand Down
Loading