Claude/build install script 011 c uqe6w5 e bj qknd w48f e9 n#5
Merged
santoshkumarradha merged 8 commits intomainfrom Nov 6, 2025
Merged
Conversation
Implements a complete installation system for the AgentField CLI following
industry standards (rustup, nvm, homebrew patterns).
## Changes
### Installation Scripts
- **scripts/install.sh**: Production installer for macOS/Linux
- Auto-detects OS and architecture
- Downloads binaries from GitHub releases
- SHA256 checksum verification
- Installs to ~/.agentfield/bin (no sudo required)
- Automatic PATH configuration for bash/zsh/fish
- Support for version pinning (VERSION=v1.0.0)
- Idempotent (safe to re-run)
- Colored output with clear error messages
- **scripts/install.ps1**: Windows PowerShell installer
- Same features as bash installer
- Configures Windows user PATH
- PowerShell-native implementation
- **scripts/uninstall.sh**: Uninstaller for macOS/Linux
- Removes ~/.agentfield directory
- Cleans PATH from shell configs
- Creates backups before modifying configs
- Interactive confirmation prompts
- **scripts/install-dev-deps.sh**: Renamed from install.sh
- Preserves original dev dependency installer
- Used by 'make install' for developers
### Build Configuration
- **.goreleaser.yml**: Updated for raw binary distribution
- Changed from archives to raw binaries
- Binary naming: agentfield-{os}-{arch}
- Builds from control-plane/cmd/af
- Output binary named 'agentfield'
- Generates checksums.txt (SHA256)
- Enhanced GitHub release template with install instructions
- Added version/commit/date to binary via ldflags
### Documentation
- **README.md**: Added comprehensive Installation section
- Quick install commands for all platforms
- Version pinning examples
- Manual installation instructions
- Uninstall instructions
- Platform-specific guidance
### Build System
- **Makefile**: Updated to use install-dev-deps.sh
## Installation Usage
One-line install (recommended):
```bash
curl -fsSL https://agentfield.ai/install.sh | bash
```
Windows:
```powershell
iwr -useb https://agentfield.ai/install.ps1 | iex
```
Version pinning:
```bash
VERSION=v1.0.0 curl -fsSL https://agentfield.ai/install.sh | bash
```
## Binary Distribution
GoReleaser now produces:
- agentfield-darwin-amd64
- agentfield-darwin-arm64
- agentfield-linux-amd64
- agentfield-linux-arm64
- agentfield-windows-amd64.exe
- checksums.txt
All available at GitHub Releases for each version tag.
## Testing
To test locally (requires a GitHub release to exist):
```bash
# Test install script
bash scripts/install.sh
# Test with verbose output
VERBOSE=1 bash scripts/install.sh
# Test uninstall
bash scripts/uninstall.sh
```
The install scripts will be hosted at:
- https://agentfield.ai/install.sh
- https://agentfield.ai/install.ps1
- https://agentfield.ai/uninstall.sh
Resolves requirement for production CLI distribution system.
Enhances the GitHub Actions release workflow to support manual triggering with the ability to publish releases, making the install script immediately usable without requiring git tag pushes. ## Changes ### Workflow Enhancements (.github/workflows/release.yml) - Added `publish_release` input option (boolean) - When enabled: Creates GitHub release with binaries - When disabled: Builds artifacts only (for testing) - Added `version` input (string, required when publishing) - Automatically creates git tag during workflow - Validates version is provided when publishing - Workflow now supports three modes: 1. Manual trigger without publish (testing/CI) 2. Manual trigger with publish (creates release) 3. Git tag push (automatic release - existing behavior) ### Documentation - Added RELEASE.md with comprehensive release process guide - Step-by-step manual workflow instructions - Git tag push instructions - Release artifact overview - Testing procedures - Rollback procedures - First release (v0.1.0) checklist ## Use Cases ### Testing Builds (No Publish) 1. Go to Actions → Release workflow 2. Run workflow with publish_release=false 3. Download artifacts to test locally ### Creating Releases (With Publish) 1. Go to Actions → Release workflow 2. Fill in version (e.g., v0.1.0) 3. Check publish_release=true 4. Run workflow 5. Binaries published to GitHub releases 6. Install script works immediately ### Automatic Releases (Existing) ```bash git tag -a v0.1.0 -m "Release v0.1.0" git push origin v0.1.0 ``` ## Benefits - ✅ No local git tag required for releases - ✅ Can create releases directly from GitHub UI - ✅ Test builds without publishing - ✅ Install script works immediately after release - ✅ Maintains backward compatibility with tag-based releases ## Next Steps To create the first release (v0.1.0): 1. Merge this branch to main 2. Use manual workflow trigger method (see RELEASE.md) 3. Test install script: curl -fsSL https://agentfield.ai/install.sh | bash Related to installation system implementation.
Fixes GoReleaser configuration errors and optimizes the GitHub Actions
workflow for faster release builds.
## Problems Fixed
### 1. GoReleaser Configuration Error
**Error:** "only version: 2 configuration files are supported, yours is version: 0"
**Solution:**
- Added `version: 2` to .goreleaser.yml
- Updated syntax to use spaces in template variables ({{ .Os }} not {{.Os}})
- Removed deprecated `archives.builds` and `archives.format` usage
### 2. Deprecation Warnings
**Warning:** "archives.format should not be used anymore"
**Warning:** "archives.builds should not be used anymore"
**Solution:**
- Simplified archives configuration to `format: binary`
- Set binary name in builds section: `binary: agentfield-{{ .Os }}-{{ .Arch }}`
- Added `no_unique_dist_dir: true` to builds
- Removed `name_template` from archives (uses binary name directly)
## Performance Optimizations
### 1. Moved Web UI Build Out of GoReleaser
**Before:** npm ci/build ran inside GoReleaser's before hooks (~9s)
**After:** Web UI builds as separate GitHub Actions step
**Benefits:**
- Better npm caching (already configured in workflow)
- More granular control and error handling
- Clearer build logs
- Potential for future parallelization
### 2. Pinned GoReleaser Version
**Before:** `version: latest` (warning: "Will lock to '~> v2'")
**After:** `version: '~> v2'`
**Benefits:**
- Explicit version control
- Faster workflow start (no warning)
- Predictable behavior across releases
### 3. Added Docker Layer Caching
**Before:** Docker build rebuilt all layers every time
**After:** Uses GitHub Actions cache
```yaml
cache-from: type=gha
cache-to: type=gha,mode=max
```
**Benefits:**
- Faster Docker builds on subsequent runs
- Reduced CI time for Docker-enabled releases
## Binary Naming
Binaries are now correctly named at build time:
```
agentfield-darwin-amd64
agentfield-darwin-arm64
agentfield-linux-amd64
agentfield-linux-arm64
agentfield-windows-amd64.exe
```
This matches what the install script expects.
## Workflow Changes Summary
```yaml
# New step added
- name: Build Web UI
working-directory: control-plane/web/client
run: |
npm ci
npm run build
# GoReleaser version pinned
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: '~> v2' # Was: latest
# Docker caching added
- name: Build and push control plane image
uses: docker/build-push-action@v5
with:
cache-from: type=gha
cache-to: type=gha,mode=max
```
## Testing
The workflow should now:
- ✅ Build without GoReleaser version warnings
- ✅ Build without deprecation warnings
- ✅ Complete faster due to optimizations
- ✅ Produce correct binary names
- ✅ Work with install script
## Estimated Time Savings
- **npm build:** No direct time savings, but better caching
- **GoReleaser:** ~1-2s saved (no version lock warning)
- **Docker build:** ~30-60s saved on subsequent builds (with cache)
- **Overall:** ~30-60s faster for typical releases
## Related Files
- .goreleaser.yml - GoReleaser v2 configuration
- .github/workflows/release.yml - Optimized workflow
- RELEASE.md - Updated documentation (if needed)
Fixes two workflow errors that were preventing successful releases. ## Issue 1: Missing Tag for Python Artifacts Upload **Error:** ```⚠️ GitHub Releases requires a tag ``` **Cause:** The `softprops/action-gh-release@v2` action didn't know which release/tag to attach Python wheel files to. When using manual workflow trigger, we create a local tag but didn't pass it to the action. **Fix:** - Added `tag_name` output variable in "Compute GoReleaser arguments" step - Captures version from manual input or git ref name for tag pushes - Passes tag_name to `softprops/action-gh-release@v2` via `tag_name` parameter **Code:** ```yaml # In Compute GoReleaser arguments step echo "tag_name=${VERSION_INPUT}" >> "$GITHUB_OUTPUT" # Manual trigger echo "tag_name=${REF_NAME}" >> "$GITHUB_OUTPUT" # Tag push # In Attach Python artifacts step - name: Attach Python artifacts to GitHub release uses: softprops/action-gh-release@v2 with: tag_name: ${{ steps.goreleaser.outputs.tag_name }} # Added files: | sdk/python/dist/*.whl sdk/python/dist/*.tar.gz ``` ## Issue 2: Go Cache Warning **Warning:** ``` Restore cache failed: Dependencies file is not found in /home/runner/work/agentfield/agentfield. Supported file pattern: go.sum ``` **Cause:** Cache was looking for `**/go.sum` but the file is only at `control-plane/go.sum`. **Fix:** Changed cache path pattern from `**/go.sum` to `control-plane/go.sum` **Code:** ```yaml - name: Cache Go modules uses: actions/cache@v4 with: key: ${{ runner.os }}-release-go-${{ hashFiles('control-plane/go.sum') }} ``` ## Impact ### Before (Broken) ``` ❌ Python artifacts fail to attach to release⚠️ Go cache always misses (no caching benefit) ``` ### After (Fixed) ``` ✅ Python .whl and .tar.gz files attach to release ✅ Go modules cache correctly (faster builds) ``` ## Testing The next workflow run should: 1. Successfully attach Python artifacts to the release 2. Use Go cache (faster on subsequent runs) 3. Complete without errors ## Related Files - .github/workflows/release.yml - Fixed tag_name and cache path
Fixes the release failure where GoReleaser couldn't generate changelog due to tag comparison 404 errors. ## Problem ``` ⨯ release failed after 4m51s error=GET https://api.github.com/repos/Agent-Field/agentfield/compare/v0.1.0...0.0.1-alpha?per_page=100: 404 Not Found [] ``` **Root cause:** - GoReleaser was using `changelog.use: github` which queries GitHub API - It tried to compare tags to generate changelog - One or both tags didn't exist on GitHub, causing 404 - This happens on first releases or when tags are only created locally ## Solution Changed changelog generation method: ```yaml # Before (GitHub API-based) changelog: use: github # Queries GitHub API, fails if tags don't exist # After (Git-based) changelog: use: git # Uses local git commits, always works abbrev: 0 # Show full commit hashes ``` **Benefits:** - ✅ No external API calls required - ✅ Works on first release - ✅ Works when tags only exist locally - ✅ Faster (no network calls) - ✅ More reliable ## Additional Improvement Added archive ID for clarity: ```yaml archives: - id: default # Added explicit ID format: binary ``` This makes the config more explicit and easier to extend in the future. ## Impact ### Before (Broken) ``` ❌ Changelog generation fails with 404 ❌ Release process halts ❌ No binaries published ``` ### After (Fixed) ``` ✅ Changelog generated from git commits ✅ Release completes successfully ✅ Binaries published to GitHub release ``` ## Testing The next workflow run should: 1. Generate changelog from git commits (no API calls) 2. Complete without 404 errors 3. Publish all binaries successfully ## Related - Still ships raw binaries (not archives) - Changelog still groups commits by type (feat/fix/others) - Filters still exclude docs/test/chore commits
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing
./scripts/test-all.shChecklist
CHANGELOG.md(or this change does not warrant a changelog entry).Screenshots (if UI-related)
Related issues