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
187 changes: 187 additions & 0 deletions .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
name: Build Release Binaries

on:
release:
types: [created]
workflow_dispatch:
inputs:
tag:
description: 'Release tag to build for'
required: true
type: string

jobs:
build-macos:
name: Build macOS Binaries
runs-on: macos-latest
strategy:
matrix:
arch: [x86_64, arm64]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name || inputs.tag }}

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Build for ${{ matrix.arch }}
run: |
chmod +x build_scripts/build-macos-standalone.sh
bash build_scripts/build-macos-standalone.sh
env:
ARCH: ${{ matrix.arch }}

- name: Verify build
run: |
ARCH_NAME=${{ matrix.arch == 'arm64' && 'arm64' || 'amd64' }}
if [ ! -f "dist/runagent-macos-${ARCH_NAME}.tar.gz" ]; then
echo "❌ Build artifact not found!"
exit 1
fi
echo "✅ Build artifact verified"
ls -lh dist/runagent-macos-${ARCH_NAME}.tar.gz

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: runagent-macos-${{ matrix.arch }}
path: dist/runagent-macos-*.tar.gz
retention-days: 1

build-linux:
name: Build Linux Binaries
runs-on: ubuntu-latest
strategy:
matrix:
arch: [x86_64, aarch64]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name || inputs.tag }}

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential python3-dev ccache patchelf

- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Build for ${{ matrix.arch }}
run: |
chmod +x build_scripts/build-linux-standalone.sh
bash build_scripts/build-linux-standalone.sh
env:
ARCH: ${{ matrix.arch }}

- name: Verify build
run: |
ARCH_NAME=${{ matrix.arch == 'aarch64' && 'arm64' || 'amd64' }}
if [ ! -f "dist/runagent-linux-${ARCH_NAME}.tar.gz" ]; then
echo "❌ Build artifact not found!"
exit 1
fi
echo "✅ Build artifact verified"
ls -lh dist/runagent-linux-${ARCH_NAME}.tar.gz

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: runagent-linux-${{ matrix.arch }}
path: dist/runagent-linux-*.tar.gz
retention-days: 1

build-windows:
name: Build Windows Binaries
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name || inputs.tag }}

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Build for Windows
run: |
powershell -ExecutionPolicy Bypass -File build_scripts\build-windows-standalone.ps1

- name: Verify build
run: |
if (-not (Test-Path "dist\runagent-windows-amd64.zip")) {
Write-Host "❌ Build artifact not found!"
exit 1
}
Write-Host "✅ Build artifact verified"
Get-Item dist\runagent-windows-amd64.zip | Format-List
shell: pwsh

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: runagent-windows-amd64
path: dist/runagent-windows-*.zip
retention-days: 1

upload-to-release:
name: Upload Binaries to Release
needs: [build-macos, build-linux, build-windows]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: artifacts

- name: Display structure
run: |
echo "📦 Downloaded artifacts:"
ls -R artifacts/

- name: Flatten artifacts
run: |
mkdir -p release-assets
find artifacts -type f \( -name "*.tar.gz" -o -name "*.zip" \) -exec cp {} release-assets/ \;
echo "📋 Release assets:"
ls -lh release-assets/

- name: Upload to release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.release.tag_name || inputs.tag }}
files: release-assets/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97 changes: 82 additions & 15 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ jobs:
environment: release
permissions:
contents: write
outputs:
release_created: ${{ steps.create-release.outputs.release_created }}

steps:
- uses: actions/checkout@v4
with:
Expand All @@ -162,7 +165,6 @@ jobs:
# Function to extract changelog section
extract_section() {
local pattern="$1"
# Extract from the pattern to the next ## or end of file
awk -v pattern="$pattern" '
/^## \[/ {
if (found) exit
Expand All @@ -172,31 +174,27 @@ jobs:
' CHANGELOG.md | sed '/^<!-- generated by git-cliff -->/d'
}

# Try to find the changelog section
CHANGELOG_CONTENT=""

if grep -q "## \[$VERSION\]" CHANGELOG.md; then
CHANGELOG_CONTENT=$(extract_section "\\[$VERSION\\]")
elif grep -q "## \[$TAG\]" CHANGELOG.md; then
CHANGELOG_CONTENT=$(extract_section "\\[$TAG\\]")
else
# Fallback: get the first version section (usually the latest)
CHANGELOG_CONTENT=$(awk '/^## \[/,/^## \[|^$/' CHANGELOG.md | tail -n +2 | head -n -1 | sed '/^<!-- generated by git-cliff -->/d')
fi

# If still empty, provide a default message
if [ -z "$CHANGELOG_CONTENT" ]; then
CHANGELOG_CONTENT="No changelog entries found for this version."
fi

# Output using multiline format for GitHub Actions
{
echo 'changelog<<CHANGELOG_EOF'
echo "$CHANGELOG_CONTENT"
echo 'CHANGELOG_EOF'
} >> "$GITHUB_OUTPUT"

- name: Create main GitHub Release
id: create-release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.detect-release.outputs.latest_tag }}
Expand All @@ -212,24 +210,66 @@ jobs:

## 📦 Installation

```bash
### Python
```bash
pip install runagent==${{ needs.detect-release.outputs.version }}
```
```

```bash
### TypeScript/JavaScript
```bash
npm install @runagent/sdk@${{ needs.detect-release.outputs.version }}
```
```

```bash
### Rust
```bash
cargo add runagent@${{ needs.detect-release.outputs.version }}
```
```

```bash
### Go
```bash
go get github.com/runagent-dev/runagent-go@${{ needs.detect-release.outputs.latest_tag }}
```
```

## 🖥️ CLI Binaries

Standalone CLI binaries are available below. Download for your platform:

### Quick Install (Unix)
```bash
# macOS
curl -L https://github.com/${{ github.repository }}/releases/download/${{ needs.detect-release.outputs.latest_tag }}/runagent-macos-$(uname -m | sed 's/x86_64/amd64/').tar.gz | tar -xz
sudo cp -r runagent_entry.dist /usr/local/lib/
sudo ln -sf /usr/local/lib/runagent_entry.dist/runagent /usr/local/bin/runagent

# Linux
curl -L https://github.com/${{ github.repository }}/releases/download/${{ needs.detect-release.outputs.latest_tag }}/runagent-linux-$(uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/').tar.gz | tar -xz
sudo cp -r runagent_entry.dist /usr/local/lib/
sudo ln -sf /usr/local/lib/runagent_entry.dist/runagent /usr/local/bin/runagent
```

### Manual Download
- **macOS (Intel)**: `runagent-macos-amd64.tar.gz`
- **macOS (Apple Silicon)**: `runagent-macos-arm64.tar.gz`
- **Linux (x86_64)**: `runagent-linux-amd64.tar.gz`
- **Linux (ARM64)**: `runagent-linux-arm64.tar.gz`
- **Windows (x64)**: `runagent-windows-amd64.zip`

### Package Managers (Coming Soon)
```bash
# Homebrew (macOS)
brew install runagent

# WinGet (Windows)
winget install runagent

# Scoop (Windows)
scoop install runagent
```

---

⚡ **Performance**: CLI binaries have ~1-2s startup time (10-20x faster than Python execution)

For the full changelog, see [CHANGELOG.md](./CHANGELOG.md).

draft: false
Expand All @@ -238,4 +278,31 @@ jobs:
files: |
CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set release created output
run: echo "release_created=true" >> $GITHUB_OUTPUT

# NEW: Trigger binary builds after release is created
trigger-binary-builds:
name: Trigger Binary Builds
needs: [detect-release, create-release]
if: needs.create-release.outputs.release_created == 'true'
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Trigger build-binaries workflow
uses: actions/github-script@v7
with:
script: |
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'build-binaries.yml',
ref: 'main',
inputs: {
tag: '${{ needs.detect-release.outputs.latest_tag }}'
}
});
console.log('✅ Triggered binary builds for ${{ needs.detect-release.outputs.latest_tag }}');
Loading