Improve versioning and building

pull/2/head
Jean-Marc MEESSEN 4 years ago
parent efb75a4d4e
commit 0716f4565a

@ -2,15 +2,7 @@
set -e set -e
VERSION_FROM_GIT=$(git describe --tags) ./update-version.sh
BUILD_TIME=$(date +%F)
echo "$VERSION_FROM_GIT"
echo "$BUILD_TIME"
echo "package cmd" > cmd/FLEcli_version.go
echo " " >> cmd/FLEcli_version.go
echo "//VersionString is the version that will be displayed with the -v switch" >> cmd/FLEcli_version.go
echo "const VersionString = \"${VERSION_FROM_GIT} (${BUILD_TIME})\"" >> cmd/FLEcli_version.go
go build go build
go test ./... go test ./...

@ -1,4 +1,4 @@
package cmd package cmd
//VersionString is the version that will be displayed with the -v switch //VersionString is the version that will be displayed with the -v switch
const VersionString = "v0.0.0.0-1-gb264805 (2020-07-13)" const VersionString = "v0.0.0.0-3-gefb75a4 (2020-07-13)"

@ -2,13 +2,15 @@
set -e set -e
echo "Testing..."
go test ./... go test ./...
mkdir -p executables/windows mkdir -p executables/windows
mkdir -p executables/macos mkdir -p executables/macos
mkdir -p executables/linux mkdir -p executables/linux
#Update version ./update-version.sh
GOOS=windows GOARCH=386 go build -o executables/windows/FLEcli.exe GOOS=windows GOARCH=386 go build -o executables/windows/FLEcli.exe
GOOS=darwin GOARCH=amd64 go build -o executables/macos/FLEcli GOOS=darwin GOARCH=amd64 go build -o executables/macos/FLEcli

@ -0,0 +1,13 @@
#!/bin/bash
set -e
VERSION_FROM_GIT=$(git describe --tags)
BUILD_TIME=$(date +%F)
echo "Building version ${VERSION_FROM_GIT}"
echo "package cmd" > cmd/FLEcli_version.go
echo " " >> cmd/FLEcli_version.go
echo "//VersionString is the version that will be displayed with the -v switch" >> cmd/FLEcli_version.go
echo "const VersionString = \"${VERSION_FROM_GIT} (${BUILD_TIME})\"" >> cmd/FLEcli_version.go
Loading…
Cancel
Save