Small fix #2
Workflow file for this run
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 CLI Commands | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build llm | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: macos-latest | |
| arch: arm64 | |
| goos: darwin | |
| goarch: arm64 | |
| - os: ubuntu-24.04-arm | |
| arch: arm64 | |
| goos: linux | |
| goarch: arm64 | |
| - os: ubuntu-24.04 | |
| arch: amd64 | |
| goos: linux | |
| goarch: amd64 | |
| - os: windows-latest | |
| arch: amd64 | |
| goos: windows | |
| goarch: amd64 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.25" | |
| - name: Build llm-client (Unix) | |
| if: matrix.goos != 'windows' | |
| env: | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| run: make llm-client | |
| - name: Build llm-client (Windows) | |
| if: matrix.goos == 'windows' | |
| env: | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| shell: bash | |
| run: | | |
| mkdir -p build | |
| go build -ldflags "-s -w" -tags client -o build/llm.exe ./cmd/llm | |
| - name: Rename binary for release | |
| shell: bash | |
| run: | | |
| if [ "${{ matrix.goos }}" = "windows" ]; then | |
| mv build/llm.exe build/llm-${{ matrix.goos }}-${{ matrix.goarch }}.exe | |
| else | |
| mv build/llm build/llm-${{ matrix.goos }}-${{ matrix.goarch }} | |
| fi | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: llm-${{ matrix.goos }}-${{ matrix.goarch }} | |
| path: build/llm-${{ matrix.goos }}-${{ matrix.goarch }}* | |
| release: | |
| name: Create Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: ./artifacts | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: ./artifacts/**/* | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |