fix: Windows installer now finds pre-built .exe binaries from release… #26
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: Build and Commit Binaries | |
| permissions: | |
| contents: write | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| - 'feat/**' | |
| paths: | |
| - '**.go' | |
| - 'go.mod' | |
| - 'go.sum' | |
| - 'cmd/**' | |
| - 'internal/**' | |
| pull_request: | |
| branches: | |
| - main | |
| - dev | |
| - 'feat/**' | |
| paths: | |
| - '**.go' | |
| - 'go.mod' | |
| - 'go.sum' | |
| - 'cmd/**' | |
| - 'internal/**' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.23' # Use stable version compatible with 1.25.1 | |
| cache: true | |
| - name: Run tests | |
| run: go test ./... | |
| - name: Build binaries | |
| run: | | |
| echo "Building rag-code-mcp..." | |
| go build -o bin/rag-code-mcp ./cmd/rag-code-mcp | |
| echo "Building index-all..." | |
| go build -o bin/index-all ./cmd/index-all | |
| echo "Building ragcode-installer..." | |
| go build -o bin/ragcode-installer ./cmd/install | |
| chmod +x bin/* | |
| - name: Check if binaries changed | |
| id: check_changes | |
| run: | | |
| git add -f bin/ | |
| if git diff --cached --quiet; then | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit and push binaries | |
| if: github.event_name == 'push' && steps.check_changes.outputs.changed == 'true' | |
| run: | | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git add -f bin/ | |
| git commit -m "chore: auto-build binaries [skip ci]" | |
| git push |