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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ jobs:
( cd dist && sha256sum anyr-* > checksums.txt )
ls -la dist
ls -la dist/checksums.txt
test -s dist/checksums.txt || { echo "checksums.txt missing or empty"; exit 1; }
test -n "$(ls -A dist)" || { echo "no binaries in artifacts"; exit 1; }
SHORT="$(echo "${GITHUB_SHA}" | cut -c1-7)"
printf 'Beta from main (%s).\n\ncurl -fsSL https://anyrouter.dev/setup.sh | bash -s -- --channel beta\nchannel: beta\n' "$SHORT" > notes.md
Expand Down
144 changes: 122 additions & 22 deletions .github/workflows/release-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ on:
permissions:
contents: write

# Upload retry is inlined in each gh release upload step so
# workflow_dispatch of an older tag still uploads. The tag checkout used
# to compile binaries may not contain helper scripts added later.

jobs:
build:
# release: only non-prerelease; workflow_dispatch: always (tag input)
Expand Down Expand Up @@ -42,7 +46,9 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.sha }}
# Compile the tagged source. Scripts used only after this step
# (bench.py) exist on historical tags; upload retry is inlined.
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.event.release.tag_name || github.sha }}

- uses: dtolnay/rust-toolchain@stable
with:
Expand All @@ -63,7 +69,9 @@ jobs:
bin="target/${{ matrix.target }}/release/anyr.exe"
fi
strip "$bin" 2>/dev/null || true
test -s "$bin" || { echo "missing built binary $bin" >&2; exit 1; }
cp "$bin" "${{ matrix.asset }}"
test -s "${{ matrix.asset }}" || { echo "empty asset ${{ matrix.asset }}" >&2; exit 1; }

- name: bench
shell: bash
Expand All @@ -77,10 +85,29 @@ jobs:
--out "bench/${{ matrix.asset }}.json"

- name: upload ${{ matrix.asset }}
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.event.release.tag_name }}
run: gh release upload "${RELEASE_TAG}" "${{ matrix.asset }}" --clobber
run: |
set -euo pipefail
n=1
while true; do
if out=$(gh release upload "${RELEASE_TAG}" "${{ matrix.asset }}" --clobber 2>&1); then
printf '%s\n' "$out"
break
fi
printf '%s\n' "$out" >&2
if ! printf '%s\n' "$out" | grep -qi 'release not found'; then
exit 1
fi
if [ "$n" -ge 3 ]; then
echo "gh release upload failed: release not found after 3 attempts (${RELEASE_TAG})" >&2
exit 1
fi
sleep $((n * 5))
n=$((n + 1))
done

- uses: actions/upload-artifact@v4
with:
Expand All @@ -93,7 +120,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.sha }}
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.event.release.tag_name || github.sha }}

- uses: dtolnay/rust-toolchain@stable
with:
Expand Down Expand Up @@ -122,59 +149,132 @@ jobs:
--out bench/anyr.wasm.json

- name: upload wasm assets
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.event.release.tag_name }}
run: |
gh release upload "${RELEASE_TAG}" \
anyr.wasm --clobber
set -euo pipefail
n=1
while true; do
if out=$(gh release upload "${RELEASE_TAG}" anyr.wasm --clobber 2>&1); then
printf '%s\n' "$out"
break
fi
printf '%s\n' "$out" >&2
if ! printf '%s\n' "$out" | grep -qi 'release not found'; then
exit 1
fi
if [ "$n" -ge 3 ]; then
echo "gh release upload failed: release not found after 3 attempts (${RELEASE_TAG})" >&2
exit 1
fi
sleep $((n * 5))
n=$((n + 1))
done

- uses: actions/upload-artifact@v4
with:
name: bench-anyr.wasm
path: bench/anyr.wasm.json

notes:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.release.prerelease == false }}
# Checksums must ship even when one platform (often Windows upload) fails.
checksums:
if: ${{ always() && !cancelled() && (github.event_name == 'workflow_dispatch' || github.event.release.prerelease == false) }}
needs: [build, wasm]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.sha }}

- uses: actions/download-artifact@v4
with:
path: artifacts

- uses: actions/setup-python@v5
with:
python-version: "3.12"
# Workflow revision, not the tag: historical tags lack newer scripts.
ref: ${{ github.sha }}

- name: generate checksums
- name: generate and upload checksums.txt
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.event.release.tag_name }}
run: |
set -euo pipefail
mkdir -p dist
gh release download "${RELEASE_TAG}" --dir dist --pattern 'anyr-*'
gh release download "${RELEASE_TAG}" --dir dist --pattern 'anyr-*' || true
count="$(find dist -maxdepth 1 -type f -name 'anyr-*' | wc -l | tr -d ' ')"
echo "binaries on ${RELEASE_TAG}: ${count}"
ls -la dist || true
if [ "${count}" = "0" ]; then
echo "hard gate: no anyr-* binaries on ${RELEASE_TAG}; cannot write checksums.txt" >&2
exit 1
fi
( cd dist && sha256sum anyr-* > checksums.txt )
ls -la dist/checksums.txt
test -s dist/checksums.txt
cat dist/checksums.txt
n=1
while true; do
if out=$(gh release upload "${RELEASE_TAG}" dist/checksums.txt --clobber 2>&1); then
printf '%s\n' "$out"
break
fi
printf '%s\n' "$out" >&2
if ! printf '%s\n' "$out" | grep -qi 'release not found'; then
exit 1
fi
if [ "$n" -ge 3 ]; then
echo "gh release upload failed: release not found after 3 attempts (${RELEASE_TAG})" >&2
exit 1
fi
sleep $((n * 5))
n=$((n + 1))
done

notes:
if: ${{ always() && !cancelled() && (github.event_name == 'workflow_dispatch' || github.event.release.prerelease == false) }}
needs: [checksums]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.sha }}

- uses: actions/download-artifact@v4
with:
path: artifacts
continue-on-error: true

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: write changelog + bench to release
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.event.release.tag_name }}
run: |
python scripts/bench.py report artifacts \
--out bench-report.md --json-out bench-report.json \
--title "Binary size and startup (${RELEASE_TAG})"
--title "Binary size and startup (${RELEASE_TAG})" || true
python scripts/release_notes.py github \
--tag "${RELEASE_TAG}" \
--bench bench-report.md \
--out notes.md
gh release edit "${RELEASE_TAG}" --notes-file notes.md
gh release upload "${RELEASE_TAG}" \
bench-report.md bench-report.json dist/checksums.txt --clobber
if [ -f bench-report.md ]; then
n=1
while true; do
if out=$(gh release upload "${RELEASE_TAG}" \
bench-report.md bench-report.json --clobber 2>&1); then
printf '%s\n' "$out"
break
fi
printf '%s\n' "$out" >&2
if ! printf '%s\n' "$out" | grep -qi 'release not found'; then
exit 1
fi
if [ "$n" -ge 3 ]; then
echo "gh release upload failed: release not found after 3 attempts (${RELEASE_TAG})" >&2
exit 1
fi
sleep $((n * 5))
n=$((n + 1))
done
fi
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ GitHub Releases use this file as the release notes (full history through that ta
* **cli:** keep Claude HUD floors on virtual presets end-to-end (ANTHROPIC_MODEL, extra-body min_context, compact window, no catalog remap)
* **cli:** bare `anyr update` keeps the config channel; only `--beta`/`--stable` persist a switch
* **cli:** skip a broken latest GitHub release (checksum / missing asset) and install the next good build on that channel
* **cli:** print update warnings on a new line so they are not glued to the spinner
* **ci:** upload checksums.txt even when one platform build fails; retry Windows release-not-found uploads


## [0.1.14](https://github.com/anyrouter-dev/cli/compare/v0.1.13...v0.1.14) (2026-09-15)
Expand Down
Loading
Loading