Skip to content

Commit

Permalink
Set the version number of sing-box automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
parhelia512 committed Jan 4, 2025
1 parent c8028a1 commit abe97f9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
9 changes: 0 additions & 9 deletions core/cmd/nekobox_core/internal/boxbox/version.go

This file was deleted.

4 changes: 2 additions & 2 deletions core/cmd/nekobox_core/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (

"nekobox_core/server"

"nekobox_core/internal/boxbox"
C "github.com/sagernet/sing-box/constant"
_ "nekobox_core/internal/distro/all"
)

func main() {
fmt.Println("sing-box:", boxbox.Version)
fmt.Println("sing-box:", C.Version)
fmt.Println()
runtimeDebug.SetMemoryLimit(2 * 1024 * 1024 * 1024) // 2GB
go func() {
Expand Down
3 changes: 2 additions & 1 deletion script/build_go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ popd

#### Go: nekobox_core ####
pushd core/cmd/nekobox_core
go build -v -o $DEST -trimpath -ldflags "-w -s" -tags "with_clash_api,with_gvisor,with_quic,with_wireguard,with_utls,with_ech,with_dhcp"
VERSION_SINGBOX=$(go list -m -f '{{.Version}}' github.com/sagernet/sing-box)
go build -v -o $DEST -trimpath -ldflags "-w -s -X 'github.com/sagernet/sing-box/constant.Version=${VERSION_SINGBOX}'" -tags "with_clash_api,with_gvisor,with_quic,with_wireguard,with_utls,with_ech,with_dhcp"
popd

0 comments on commit abe97f9

Please sign in to comment.