feat: recover ACP runtime service sessions #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Binaries | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| concurrency: | |
| group: release-binaries-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| env: | |
| ACP_RUNTIME_REPO_URL: https://github.com/saaskit-dev/acp-runtime.git | |
| BUN_VERSION: 1.3.14 | |
| FREE_BINARY_TARGETS: bun-darwin-arm64,bun-darwin-x64,bun-linux-arm64,bun-linux-x64 | |
| jobs: | |
| release-binaries: | |
| name: Build and publish latest binaries | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - name: Checkout Free | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Clone pinned acp-runtime | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| ACP_RUNTIME_REF="$(sed -e 's/[[:space:]]*$//' -e '/^$/d' .acp-runtime-ref | head -n 1)" | |
| if [ -z "$ACP_RUNTIME_REF" ]; then | |
| echo "Missing pinned acp-runtime ref in .acp-runtime-ref" >&2 | |
| exit 1 | |
| fi | |
| rm -rf ../acp-runtime | |
| git init ../acp-runtime | |
| git -C ../acp-runtime remote add origin "$ACP_RUNTIME_REPO_URL" | |
| git -C ../acp-runtime fetch --depth 1 origin "$ACP_RUNTIME_REF" | |
| git -C ../acp-runtime checkout --detach FETCH_HEAD | |
| - name: Install and build pinned acp-runtime | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| cd ../acp-runtime | |
| bun install --frozen-lockfile | |
| bun run --cwd packages/simulator-agent build | |
| bun run build:lib | |
| - name: Install Free dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Build Bun binaries | |
| run: make build-binary | |
| - name: Smoke-test Linux binary | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| ./dist-bin/free-linux-x64 --help >/dev/null | |
| ./dist-bin/free-linux-x64 auth --help >/dev/null | |
| ./dist-bin/free-linux-x64 host --help >/dev/null | |
| ./dist-bin/free-linux-x64 bridge config --relay-url ws://127.0.0.1:8791 --command ./dist-bin/free-linux-x64 --format generic >/dev/null | |
| - name: Generate checksums | |
| run: shasum -a 256 dist-bin/free-* > dist-bin/SHA256SUMS | |
| - name: Publish latest GitHub release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git tag -f latest "$GITHUB_SHA" | |
| git push -f origin latest | |
| mkdir -p .tmp | |
| cat > .tmp/latest-release-notes.md <<EOF | |
| Latest Free binary build from ${GITHUB_SHA}. | |
| Install: | |
| curl -fsSL https://free.saaskit.app/install | bash | |
| Direct assets are attached to this release. | |
| EOF | |
| if gh release view latest >/dev/null 2>&1; then | |
| gh release edit latest \ | |
| --target "$GITHUB_SHA" \ | |
| --title "Latest Free binary" \ | |
| --notes-file .tmp/latest-release-notes.md | |
| else | |
| gh release create latest \ | |
| --target "$GITHUB_SHA" \ | |
| --title "Latest Free binary" \ | |
| --notes-file .tmp/latest-release-notes.md | |
| fi | |
| gh release upload latest dist-bin/free-* dist-bin/SHA256SUMS --clobber |