gitee.com/quant1x/engine@v1.8.4/publish-windows.ps1 (about) 1 # engine 编译脚本 2 # author: wangfeng 3 # since: 2023-09-12 4 5 $commit_id = (git rev-list --tags --max-count = 1) | Out-String 6 $command = "git describe --tags ${commit_id}" 7 $repo = (Invoke-Expression $command) | Out-String 8 $version = $repo.Substring(1).Trim() 9 Write-Output "quant version: ${version}" 10 $repo = (go list -m gitee.com/quant1x/gotdx) | Out-String 11 $gotdx_version = ($repo -split " ")[1] 12 $gotdx_version = $gotdx_version.Substring(1).Trim() 13 Write-Output "gotdx version: $gotdx_version" 14 15 $BIN = "./bin" 16 $APP = "stock" 17 $EXT = ".exe" 18 $repo = "gitee.com/quant1x/engine" 19 $GOOS = "windows" 20 $GOARCH = $env:PROCESSOR_ARCHITECTURE 21 $GOARCH = $GOARCH.Trim().ToLower() 22 $command = "go env -w GOOS=${GOOS} GOARCH=${GOARCH}; go build -ldflags `"-s -w -X 'main.MinVersion=$version' -X 'main.tdxVersion=$gotdx_version'`" -o ${BIN}/${APP}${EXT} ${repo}" 23 Write-Output $command 24 Invoke-Expression $command