Conversation
Co-authored-by: streed <805140+streed@users.noreply.github.com>
…workflow Co-authored-by: streed <805140+streed@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR implements a comprehensive cross-platform build system with automatic versioning that triggers on main branch merges. The system automatically increments patch versions, builds binaries for multiple platforms (Linux, macOS, Windows), and embeds version information into the executables.
- Automatic patch version incrementing on main branch pushes (e.g., 1.0.0 → 1.0.1)
- Cross-platform binary builds for Linux, macOS, and Windows with embedded version information
- Version display functionality added to both CLI and server applications
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| VERSION | Initial version file containing "1.0.0" |
| .github/workflows/main-build.yml | GitHub Actions workflow for automated builds and version management |
| cmd/lil-rag/main.go | Added version variable and --version flag to CLI |
| cmd/lil-rag-server/main.go | Added version variable, --version flag, and version logging to server |
| internal/handlers/handlers.go | Added version field to Handler struct and versioned constructor |
| internal/handlers/handlers_test.go | Updated tests for new versioned constructor |
| Makefile | Enhanced build targets with version embedding and cross-platform support |
| README.md | Added documentation for version management and cross-platform builds |
| CONTRIBUTING.md | Updated release process documentation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| - name: Commit version update | ||
| run: | | ||
| git config --local user.email "action@github.com" | ||
| git config --local user.name "GitHub Action" | ||
| git add VERSION | ||
| if git diff --staged --quiet; then | ||
| echo "No version changes to commit" | ||
| else | ||
| git commit -m "Bump version to ${{ steps.version.outputs.new }} [skip ci]" | ||
| git push | ||
| fi |
There was a problem hiding this comment.
This workflow will fail on the first run because it attempts to increment a version before any version bump commits exist. The git diff --staged --quiet check will always be false since VERSION is always modified in the previous step, making the conditional logic ineffective.
| @echo "All tasks completed successfully!" | ||
|
|
||
| build-cross: ## Build binaries for all platforms | ||
| @echo "Building cross-platform binaries version $(VERSION)..." |
There was a problem hiding this comment.
The cross-compilation targets assume availability of cross-compilers (aarch64-linux-gnu-gcc, x86_64-w64-mingw32-gcc) without installation steps. This will fail on systems without these cross-compilers installed, making the build-cross target unreliable for local development.
This PR implements a comprehensive build system that automatically creates cross-platform binaries when code is merged to the main branch, addressing the requirements for Windows, Linux, and macOS builds with semantic versioning.
Key Features
Automatic Version Management
1.0.0--version) added to both CLI and server applicationsCross-Platform Build Support
The new GitHub Actions workflow builds binaries for:
All builds include:
-ldflags="-s -w"Build Triggers
main, not on PRs[skip ci]to prevent infinite loopsDeveloper Experience
Enhanced Makefile with new targets:
Example Usage
Technical Implementation
Minimal Code Changes
New()constructorWorkflow Design
The GitHub Actions workflow (
main-build.yml):[skip ci]flagDocumentation Updates
Testing
This implementation provides a robust, automated build system that scales with the project while maintaining simplicity for developers.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.