-
Notifications
You must be signed in to change notification settings - Fork 2
98 lines (86 loc) · 2.3 KB
/
Copy pathcli.yml
File metadata and controls
98 lines (86 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
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 (Unix)
if: matrix.goos != 'windows'
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: make llm
- name: Build llm (Windows)
if: matrix.goos == 'windows'
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
shell: bash
run: |
mkdir -p build
go build -ldflags "-s -w" -o build/llm.exe ./cmd/llmserver
- 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 }}