Skip to content

Commit e39a519

Browse files
committed
feat: set version properly
1 parent 2fc1e48 commit e39a519

File tree

3 files changed

+36
-32
lines changed

3 files changed

+36
-32
lines changed

.github/release-please/config.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@
1717
},
1818
"extra-files": [
1919
"README.md"
20-
],
21-
"pull-request-footer": ""
20+
]
2221
}

cmd/firebolt-mcp-server/main.go

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import (
77
"math/rand"
88
"os"
99
"os/signal"
10+
"runtime"
11+
"runtime/debug"
1012
"syscall"
1113

1214
"github.com/urfave/cli/v3"
@@ -18,7 +20,12 @@ import (
1820
"github.com/firebolt-db/mcp-server/pkg/resources"
1921
"github.com/firebolt-db/mcp-server/pkg/server"
2022
"github.com/firebolt-db/mcp-server/pkg/tools"
21-
"github.com/firebolt-db/mcp-server/pkg/version"
23+
)
24+
25+
var (
26+
version string = "0.0.0"
27+
commit string = "unknown"
28+
date string = "unknown"
2229
)
2330

2431
func main() {
@@ -29,7 +36,7 @@ func main() {
2936
cmd := &cli.Command{
3037
Name: "firebolt-mcp-server",
3138
Usage: "Model Context Protocol implementation that connects your LLM to Firebolt",
32-
Version: version.GetFullVersion(),
39+
Version: fullVersion(),
3340
Authors: []any{"Firebolt Team"},
3441
Description: "" +
3542
"This MCP makes your LLM an expert in Firebolt cloud data warehouse with access to specialized tools and resources.\n" +
@@ -140,7 +147,7 @@ func run(ctx context.Context, cmd *cli.Command) error {
140147
)
141148

142149
// Start the server
143-
logger.Info("Welcome to Firebolt MCP Server!", "version", version.GetFullVersion())
150+
logger.Info("Welcome to Firebolt MCP Server!", "version", version)
144151
if err = srv.Serve(ctx); err != nil {
145152
return fmt.Errorf("failed to start server: %w", err)
146153
}
@@ -157,3 +164,28 @@ func generateRandomSecret() string {
157164
}
158165
return string(b)
159166
}
167+
168+
func fullVersion() string {
169+
170+
buildInfo, ok := debug.ReadBuildInfo()
171+
if ok {
172+
return fmt.Sprintf(
173+
"%s (%s/%s, %s, %s, %s)",
174+
version,
175+
runtime.GOOS,
176+
runtime.GOARCH,
177+
buildInfo.GoVersion,
178+
date,
179+
commit,
180+
)
181+
}
182+
183+
return fmt.Sprintf(
184+
"%s (%s/%s, %s, %s)",
185+
version,
186+
runtime.GOOS,
187+
runtime.GOARCH,
188+
date,
189+
commit,
190+
)
191+
}

pkg/version/version.go

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)