Skip to content

Commit

Permalink
cmd/version: Drop the exported VersionDetails
Browse files Browse the repository at this point in the history
  • Loading branch information
codebien committed Sep 8, 2023
1 parent 55ec83c commit c944ebf
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
5 changes: 0 additions & 5 deletions build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,13 @@ export OUT_DIR="${1-dist}"
# To override the latest git tag as the version, pass something else as the second arg.
export VERSION=${2:-$(git describe --tags --always --dirty)}

# To overwrite the version details, pass something as the third arg. Empty string disables it.
export VERSION_DETAILS=${3-"$(date -u +"%FT%T%z")/$(git describe --tags --always --long --dirty)"}
set +x

build() {
local ALIAS="$1" SUFFIX="${2}" # Any other arguments are passed to the go build command as env vars
local NAME="k6-${VERSION}-${ALIAS}"

local BUILD_ARGS=(-o "${OUT_DIR}/${NAME}/k6${SUFFIX}" -trimpath)
if [ -n "$VERSION_DETAILS" ]; then
BUILD_ARGS+=(-ldflags "-X go.k6.io/k6/lib/consts.VersionDetails=$VERSION_DETAILS")
fi

local PACKAGE_FORMATS
IFS="," read -ra PACKAGE_FORMATS <<< "${3}"
Expand Down
3 changes: 0 additions & 3 deletions lib/consts/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ import (
// Version contains the current semantic version of k6.
const Version = "0.46.0"

// VersionDetails can be set externally as part of the build process
var VersionDetails = "" //nolint:gochecknoglobals

// FullVersion returns the maximally full version and build information for
// the currently running k6 executable.
func FullVersion() string {
Expand Down

0 comments on commit c944ebf

Please sign in to comment.