Skip to content

AgentBridge: global 30-min wait window for dep packages (not per pack… #10

AgentBridge: global 30-min wait window for dep packages (not per pack…

AgentBridge: global 30-min wait window for dep packages (not per pack… #10

Workflow file for this run

name: Build and Release AgentBridge
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
# Release gate: when IsPrerelease=true in AgentBridge.csproj the version carries a
# "-prerelease" suffix and no GitHub release is created. See AGENTS.md.
check-version:
runs-on: ubuntu-latest
outputs:
prerelease: ${{ steps.ver.outputs.prerelease }}
version: ${{ steps.ver.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
path: AgentBridge
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Detect prerelease version
id: ver
shell: bash
run: |
# -getProperty:Version prints the raw value (single property) — grep handles both
# raw ("1.26.08.09") and JSON ({"Properties":{"Version":"..."}}) output shapes.
VER=$(dotnet msbuild AgentBridge/AgentBridge.csproj -getProperty:Version -nologo | grep -oE '[0-9]+(\.[0-9]+)*(-[a-z0-9]+)?' | head -n1)
echo "version=$VER"
case "$VER" in *-prerelease*) echo "prerelease=true" ;; *) echo "prerelease=false" ;; esac
echo "prerelease=$(case "$VER" in *-prerelease*) echo true ;; *) echo false ;; esac)" >> "$GITHUB_OUTPUT"
echo "version=$VER" >> "$GITHUB_OUTPUT"
build:
needs: check-version
if: needs.check-version.outputs.prerelease == 'false'
name: Build ${{ matrix.rid }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
rid: win-x64
ext: .exe
- os: ubuntu-latest
rid: linux-x64
ext: ''
# No linux-arm64: KokoroSharp 0.6.7 ships no espeak-ng-linux-arm64
# binary, so TTS would be broken on ARM64 Linux.
- os: macos-latest
rid: osx-x64
ext: ''
- os: macos-latest
rid: osx-arm64
ext: ''
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: AgentBridge
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
# The dependency NuGet packages are date-versioned (1.yy.MM.dd) and published by each
# repo's publish.yml when sync-all.ps1 pushed them; nuget.org propagation is not
# instant (official figures: up to 30 minutes). A GLOBAL 30-minute window from the start
# of the wait: each cycle checks ALL packages and ends as soon as every one is visible;
# after the window, packages still missing (only changed repos publish today) are
# reported with a warning and the build proceeds — the floating 1.* restore picks the
# latest available version, which for an unchanged repo is identical to today's version.
- name: Wait for dependency packages on NuGet
shell: bash
env:
VERSION: ${{ needs.check-version.outputs.version }}
run: |
NVER=$(printf '%s' "$VERSION" | awk -F. '{for(i=1;i<=NF;i++){gsub(/^0+/,"",$i); if($i=="")$i=0; printf "%s%s",(i>1?".":""),$i} print ""}')
echo "Waiting for dependency packages at version $NVER ..."
for i in $(seq 1 60); do
missing=""
for pkg in graphene.aiorchestrator alltomarkdown mermaidrendering graphene.reversemarkdown uisupportgeneric; do
if curl -fsS "https://api.nuget.org/v3-flatcontainer/$pkg/index.json" | grep -q "\"$NVER\""; then
echo "$pkg $NVER available (attempt $i)"
else
missing="$missing $pkg"
fi
done
if [ -z "$missing" ]; then break; fi
sleep 30
done
if [ -n "$missing" ]; then
echo "::warning::after 30 min these packages are not yet at $NVER; proceeding with the latest available version (no publish for these repos today):$missing"
fi
# Builds against the published NuGet packages (Graphene.AIOrchestrator 1.* and its
# dependencies) — the sibling repos are private and never checked out here.
- name: Publish
shell: bash
run: |
dotnet publish AgentBridge/AgentBridge.csproj -c Release -r ${{ matrix.rid }} \
--self-contained true \
-p:PublishSingleFile=true \
-p:IncludeNativeLibrariesForSelfExtract=true \
-p:DebugType=None -p:DebugSymbols=false \
-o ./publish
# The archive deliberately ships kokoro.onnx (325 MB) plus the KokoroSharp
# voices/ and espeak-ng-data/ content: single-file publish bundles managed
# code only, and the TTS endpoints need those assets next to the exe.
# chmod: on Linux/macOS the espeak-ng binaries must stay executable inside
# the tarball (NuGet extraction does not preserve exec bits).
- name: Package
shell: bash
run: |
chmod +x publish/espeak/espeak-ng-*.dll
cd publish
tar -czf ../agentbridge-${{ matrix.rid }}.tar.gz .
cd ..
ls -lh agentbridge-${{ matrix.rid }}.tar.gz
- name: Attach to Release
uses: softprops/action-gh-release@v2
with:
files: agentbridge-${{ matrix.rid }}.tar.gz