File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ before_install:
1313
1414before_deploy :
1515 - go build -v --tags static -ldflags "-X main.Version=${TRAVIS_TAG}"
16+ - v=$(${PWD}/gtm verify "${TRAVIS_TAG}"); echo "$v"; if [ ! "$v" == "true" ]; then exit 1; fi
1617 - tar -zcf gtm.${TRAVIS_TAG}.${TRAVIS_OS_NAME}.tar.gz gtm
1718 - shasum -a 256 gtm.${TRAVIS_TAG}.${TRAVIS_OS_NAME}.tar.gz > gtm.${TRAVIS_TAG}.${TRAVIS_OS_NAME}.checksum.txt
1819
Original file line number Diff line number Diff line change 11BINARY = bin/gtm
2- VERSION = gtm-dev- $( shell date +' % Y. % m. % d- % H: % M: % S')
2+ VERSION = 0.0.0-dev
33COMMIT = $(shell git show -s --format='% h' HEAD)
44LDFLAGS = -ldflags "-X main.Version=$(VERSION ) -$(COMMIT ) "
55GIT2GO_VERSION = v27
66GIT2GO_PATH = $(GOPATH ) /src/github.com/libgit2/git2go
7+ LIBGIT2_PATH = $(GIT2GO_PATH ) /vendor/libgit2
78PKGS = $(shell go list ./... | grep -v vendor)
89BUILD_TAGS = static
910
@@ -60,7 +61,7 @@ git2go-install:
6061 git submodule update --init
6162
6263git2go : git2go-install
63- cd $(GIT2GO_PATH ) /vendor/libgit2 && \
64+ cd $(LIBGIT2_PATH ) && \
6465 mkdir -p install/lib && \
6566 mkdir -p build && \
6667 cd build && \
Original file line number Diff line number Diff line change @@ -7,12 +7,16 @@ clone_folder: c:\gopath\src\github.com\git-time-metric\gtm
77skip_branch_with_pr : true
88
99environment :
10+ GOVERSION : 1.9.7
1011 GOPATH : c:\gopath
1112 PROJ_DIR : /c/gopath/src/github.com/git-time-metric/gtm
1213
1314install :
14- - go env
15+ - rmdir c:\go /s /q
16+ - appveyor DownloadFile https://storage.googleapis.com/golang/go%GOVERSION%.windows-amd64.msi
17+ - msiexec /i go%GOVERSION%.windows-amd64.msi /q
1518 - go version
19+ - go env
1620
1721build_script :
1822 - c:\msys64\usr\bin\bash -lc "cd ${PROJ_DIR} && make git2go-install"
Original file line number Diff line number Diff line change @@ -63,6 +63,10 @@ func (c VerifyCmd) Run(args []string) int {
6363 return 1
6464 }
6565
66+ // NOTE a newline is not sent when outputting to terminal.
67+ // THis makes it easier to assign to a shell variable.
68+ // For example, v=$(gtm verify "1.0.0") but because there is
69+ // no newline running gtm verify will not display anything
6670 c .output (fmt .Sprintf ("%t" , valid ))
6771 return 0
6872}
Original file line number Diff line number Diff line change @@ -24,19 +24,31 @@ cmake -DTHREADSAFE=ON \
2424 -DCURL=OFF \
2525 -G " MSYS Makefiles" \
2626 .. &&
27-
28- cmake --build . --target install
29-
30- cd " ${GIT2GO_PATH} " && go install --tags static
27+ cmake --build .
3128
3229cd " ${GOPATH} /src/github.com/git-time-metric/gtm"
3330go get -d ./...
3431go test --tags static $( go list ./... | grep -v vendor)
3532if [[ " ${APPVEYOR_REPO_TAG} " = true ]]; then
36- go build --tags static -v -ldflags " -X main.Version=${APPVEYOR_REPO_TAG_NAME} "
33+ version=${APPVEYOR_REPO_TAG_NAME}
34+ go build -v --tags static -ldflags " -X main.Version=${version} "
35+
36+ # make sure version is set correctly
37+ v=" $( ${GOPATH} /src/github.com/git-time-metric/gtm/gtm.exe verify ${version} ) "
38+ if [ ! " $v " == " true" ]; then
39+ exit 1
40+ fi
41+
3742 tar -zcf " gtm.${APPVEYOR_REPO_TAG_NAME} .windows.tar.gz" gtm.exe
3843else
39- timestamp=$( date +%s)
40- go build --tags static -v -ldflags " -X main.Version=developer-build-${timestamp} "
41- tar -zcf " gtm.developer-build-${timestamp} .windows.tar.gz" gtm.exe
44+ version=' 0.0.0-dev'
45+ go build -v --tags static -ldflags " -X main.Version=${version} "
46+
47+ # make sure version is set correctly
48+ v=" $( ${GOPATH} /src/github.com/git-time-metric/gtm/gtm.exe verify ${version} ) "
49+ if [ ! " $v " == " true" ]; then
50+ exit 1
51+ fi
52+
53+ tar -zcf " gtm.developer-build-${version} .windows.tar.gz" gtm.exe
4254fi
You can’t perform that action at this time.
0 commit comments