chore: update before new release

This commit is contained in:
krishnassh committed 2025-07-16 14:08:00 +05:30
1 parent 949a525f92
commit 6d0cd9363d
3 files changed
+13 -7

No files matched your search

+2 -1
View File
@@ -26,7 +26,8 @@ jobs:
- name: Build binary (linux amd64)
run: |
go build -o gophertube main.go
VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "dev")
go build -ldflags "-X main.version=$VERSION" -o gophertube main.go
- name: Install packaging tools
run: |
+6 -5
View File
@@ -360,11 +360,12 @@ build_gophertube() {
go mod download || print_warning "Failed to download some dependencies"
go mod tidy || print_warning "Failed to tidy Go modules"
print_status "Running make install..."
make install || {
print_error "Failed to run make install"
return 1
}
# Build GopherTube with dynamic version from latest tag
git fetch --tags > /dev/null 2>&1 || true
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "dev")
print_status "Building GopherTube with version: $LATEST_TAG"
go build -ldflags "-X main.version=$LATEST_TAG" -o gophertube main.go
print_success "GopherTube installed via make install!"
}
+5 -1
View File
@@ -9,6 +9,8 @@ import (
"github.com/spf13/cobra"
)
var version = "dev" // will be replaced at build time with -ldflags
func main() {
var rootCmd = &cobra.Command{
Use: "gophertube",
@@ -36,6 +38,7 @@ EXAMPLES:
gophertube --help # Show this help message
For more information, see the man page: man gophertube`,
Version: version,
Run: func(cmd *cobra.Command, args []string) {
app := app.NewApp()
if err := app.Run(); err != nil {
@@ -45,9 +48,10 @@ For more information, see the man page: man gophertube`,
},
}
rootCmd.SetVersionTemplate("GopherTube version: {{.Version}}\n")
if err := rootCmd.Execute(); err != nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)
}
}