mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-21 22:43:52 +00:00
fix version file generator
This commit is contained in:
parent
4ea4bfb3fa
commit
9b1783a92a
7
Makefile
7
Makefile
|
@ -123,10 +123,13 @@ dist-bbgo-darwin: \
|
|||
dist: static dist-bbgo-linux dist-bbgo-darwin desktop
|
||||
|
||||
pkg/version/version.go: .FORCE
|
||||
bash utils/generate-version-file.sh > $@
|
||||
BUILD_FLAGS="release" bash utils/generate-version-file.sh > $@
|
||||
|
||||
pkg/version/dev.go: .FORCE
|
||||
VERSION_SUFFIX="-dev" bash utils/generate-version-file.sh > $@
|
||||
BUILD_FLAGS="!release" VERSION_SUFFIX="-dev" bash utils/generate-version-file.sh > $@
|
||||
|
||||
dev-version: pkg/version/dev.go
|
||||
git commit $< -m "update dev build version"
|
||||
|
||||
version: pkg/version/version.go pkg/version/dev.go migrations
|
||||
git commit $< $(word 2,$^) -m "bump version to $(VERSION)" || true
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
//go:build !release
|
||||
// +build !release
|
||||
|
||||
package version
|
||||
|
||||
const Version = "v1.21.0-b4044156-dev"
|
||||
const Version = "v1.21.0-4ea4bfb3-dev"
|
||||
|
||||
const VersionGitRef = "4ea4bfb3"
|
||||
|
||||
const VersionGitRef = "b4044156"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
package version
|
||||
|
||||
const Version = "v1.21.0-b4044156"
|
||||
const Version = "v1.21.0-4ea4bfb3"
|
||||
|
||||
const VersionGitRef = "b4044156"
|
||||
const VersionGitRef = "4ea4bfb3"
|
||||
|
||||
|
|
|
@ -1,18 +1,24 @@
|
|||
#!/bin/bash
|
||||
PACKAGE_NAME=version
|
||||
REF=$(git show -s --format=%h -1)
|
||||
VERSION=$VERSION-$REF
|
||||
|
||||
if [[ -z $VERSION ]] ; then
|
||||
VERSION=$(git describe --tags)
|
||||
fi
|
||||
|
||||
VERSION=$VERSION-$REF
|
||||
|
||||
if [[ -z $BUILD_FLAGS ]] ; then
|
||||
BUILD_FLAGS=release
|
||||
fi
|
||||
|
||||
|
||||
if [[ -n $VERSION_SUFFIX ]] ; then
|
||||
VERSION=${VERSION}${VERSION_SUFFIX}
|
||||
fi
|
||||
|
||||
cat <<END
|
||||
// +build release
|
||||
// +build $BUILD_FLAGS
|
||||
|
||||
package $PACKAGE_NAME
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user