Skip to content

Build AFT Binary

Build AFT Binary #4

Workflow file for this run

name: Build AFT Binary
# Manually-triggered workflow that builds the AFT binary with ALL feature flags.
# Lives on the default branch so GitHub can index it. Builds any branch/tag
# via the "branch" input. Select which platforms to build via the "targets" input
# to avoid wasting runner minutes.
#
# Usage:
# gh workflow run build-aft.yml -f targets=windows -f branch=semantic-search-enhancement
# gh run download <run-id> -n aft-windows-x64 -D ./aft-build
#
# Targets: "windows", "linux", "darwin", "all" (default), or combinations like
# "windows,linux". Only selected targets are built, saving runner minutes.
on:
workflow_dispatch:
inputs:
branch:
description: "Git branch or tag to build from"
required: false
default: "main"
features:
description: "Cargo features to enable (comma-separated)"
required: false
default: "semantic-model2vec,semantic-fts5"
targets:
description: "Build targets (comma-separated): windows, linux, darwin, or all"
required: false
default: "all"
concurrency:
group: build-aft-${{ inputs.branch }}
cancel-in-progress: true
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
build-windows-x64:
name: Build Windows x64 (MSVC)
if: contains(inputs.targets, 'windows') || inputs.targets == 'all'
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
with:
ref: ${{ inputs.branch }}
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
- name: Determine features
id: features
shell: bash
run: |
FEATURES="${{ inputs.features || 'semantic-model2vec,semantic-fts5' }}"
echo "flags=$FEATURES" >> "$GITHUB_OUTPUT"
echo "Building with features: $FEATURES"
- name: Build
shell: bash
run: |
cargo build \
--release \
--target x86_64-pc-windows-msvc \
-p agent-file-tools \
--features "${{ steps.features.outputs.flags }}"
- name: Verify binary
shell: bash
run: |
BINARY="target/x86_64-pc-windows-msvc/release/aft.exe"
if [ ! -f "$BINARY" ]; then
echo "ERROR: Binary not found at $BINARY"
exit 1
fi
"$BINARY" --version
echo "Binary size: $(du -h "$BINARY" | cut -f1)"
- uses: actions/upload-artifact@v4
with:
name: aft-windows-x64
path: target/x86_64-pc-windows-msvc/release/aft.exe
if-no-files-found: error
retention-days: 7
build-linux-x64:
name: Build Linux x64
if: contains(inputs.targets, 'linux') || inputs.targets == 'all'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
with:
ref: ${{ inputs.branch }}
- uses: dtolnay/rust-toolchain@stable
- name: Determine features
id: features
shell: bash
run: |
FEATURES="${{ inputs.features || 'semantic-model2vec,semantic-fts5' }}"
echo "flags=$FEATURES" >> "$GITHUB_OUTPUT"
- name: Build
shell: bash
run: |
cargo build \
--release \
-p agent-file-tools \
--features "${{ steps.features.outputs.flags }}"
- name: Verify binary
shell: bash
run: |
BINARY="target/release/aft"
if [ ! -f "$BINARY" ]; then
echo "ERROR: Binary not found at $BINARY"
exit 1
fi
"$BINARY" --version
echo "Binary size: $(du -h "$BINARY" | cut -f1)"
- uses: actions/upload-artifact@v4
with:
name: aft-linux-x64
path: target/release/aft
if-no-files-found: error
retention-days: 7
build-darwin-arm64:
name: Build macOS ARM64
if: contains(inputs.targets, 'darwin') || inputs.targets == 'all'
runs-on: macos-latest
steps:
- uses: actions/checkout@v5
with:
ref: ${{ inputs.branch }}
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin
- name: Determine features
id: features
shell: bash
run: |
FEATURES="${{ inputs.features || 'semantic-model2vec,semantic-fts5' }}"
echo "flags=$FEATURES" >> "$GITHUB_OUTPUT"
- name: Build
shell: bash
run: |
cargo build \
--release \
--target aarch64-apple-darwin \
-p agent-file-tools \
--features "${{ steps.features.outputs.flags }}"
- name: Verify binary
shell: bash
run: |
BINARY="target/aarch64-apple-darwin/release/aft"
if [ ! -f "$BINARY" ]; then
echo "ERROR: Binary not found at $BINARY"
exit 1
fi
"$BINARY" --version
echo "Binary size: $(du -h "$BINARY" | cut -f1)"
- uses: actions/upload-artifact@v4
with:
name: aft-darwin-arm64
path: target/aarch64-apple-darwin/release/aft
if-no-files-found: error
retention-days: 7