File tree Expand file tree Collapse file tree 3 files changed +162
-0
lines changed
Expand file tree Collapse file tree 3 files changed +162
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Release
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ tags :
7+ - ' v*'
8+ pull_request :
9+ branches : [ main ]
10+
11+ jobs :
12+ test :
13+ name : Test
14+ runs-on : ubuntu-latest
15+ steps :
16+ - name : Checkout code
17+ uses : actions/checkout@v3
18+
19+ - name : Set up Go
20+ uses : actions/setup-go@v4
21+ with :
22+ go-version : ' 1.24'
23+
24+ - name : Run tests
25+ run : go test -v ./...
26+
27+ build :
28+ name : Build Binaries
29+ needs : test
30+ runs-on : ${{ matrix.os }}
31+ strategy :
32+ matrix :
33+ os : [ubuntu-latest, windows-latest]
34+ include :
35+ - os : ubuntu-latest
36+ artifact_name : mcp-search-linux
37+ asset_name : mcp-search-linux-amd64
38+ - os : windows-latest
39+ artifact_name : mcp-search-windows
40+ asset_name : mcp-search-windows-amd64.exe
41+
42+ steps :
43+ - name : Checkout code
44+ uses : actions/checkout@v3
45+
46+ - name : Set up Go
47+ uses : actions/setup-go@v4
48+ with :
49+ go-version : ' 1.24'
50+
51+ - name : Build
52+ run : go build -v -o ${{ matrix.artifact_name }} ./cmd/search
53+
54+ - name : Upload binary
55+ uses : actions/upload-artifact@v3
56+ with :
57+ name : ${{ matrix.asset_name }}
58+ path : ${{ matrix.artifact_name }}
59+
60+ release :
61+ name : Create Release
62+ needs : build
63+ runs-on : ubuntu-latest
64+ if : startsWith(github.ref, 'refs/tags/')
65+ steps :
66+ - name : Checkout code
67+ uses : actions/checkout@v3
68+
69+ - name : Download all artifacts
70+ uses : actions/download-artifact@v3
71+
72+ - name : Display structure of downloaded files
73+ run : ls -R
74+
75+ - name : Create Release
76+ id : create_release
77+ uses : softprops/action-gh-release@v1
78+ with :
79+ files : |
80+ mcp-search-linux-amd64/mcp-search-linux
81+ mcp-search-windows-amd64.exe/mcp-search-windows
82+ draft : false
83+ prerelease : false
Original file line number Diff line number Diff line change 1+ name : Release
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*'
7+
8+ jobs :
9+ goreleaser :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Checkout code
13+ uses : actions/checkout@v3
14+ with :
15+ fetch-depth : 0
16+
17+ - name : Set up Go
18+ uses : actions/setup-go@v4
19+ with :
20+ go-version : ' 1.24'
21+
22+ - name : Run GoReleaser
23+ uses : goreleaser/goreleaser-action@v4
24+ with :
25+ distribution : goreleaser
26+ version : latest
27+ args : release --clean
28+ env :
29+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1+ project_name : mcp-search
2+
3+ builds :
4+ - id : mcp-search
5+ main : ./cmd/search
6+ binary : mcp-search
7+ env :
8+ - CGO_ENABLED=0
9+ goos :
10+ - linux
11+ - windows
12+ goarch :
13+ - amd64
14+ - arm64
15+ flags :
16+ - -trimpath
17+ ldflags :
18+ - -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}
19+
20+ archives :
21+ - format : tar.gz
22+ name_template : " {{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
23+ format_overrides :
24+ - goos : windows
25+ format : zip
26+ files :
27+ - README.md
28+ - LICENSE
29+
30+ checksum :
31+ name_template : " {{ .ProjectName }}_{{ .Version }}_checksums.txt"
32+ algorithm : sha256
33+
34+ changelog :
35+ sort : asc
36+ filters :
37+ exclude :
38+ - ' ^docs:'
39+ - ' ^test:'
40+ - ' ^ci:'
41+ - ' ^chore:'
42+ - Merge pull request
43+ - Merge branch
44+
45+ release :
46+ github :
47+ owner : stablekernel
48+ name : mcp-search
49+ prerelease : auto
50+ draft : false
You can’t perform that action at this time.
0 commit comments