diff --git a/release/build.js b/release/build.js index 4d706cc..999aeb8 100644 --- a/release/build.js +++ b/release/build.js @@ -180,15 +180,15 @@ async function main(args) { } let version = "head"; - if (process.env.CI_BUILD_TAG) { - version = process.env.CI_BUILD_TAG; + if (process.env.CI_COMMIT_TAG) { + version = process.env.CI_COMMIT_TAG; } else if ( - process.env.CI_BUILD_REF_NAME && - process.env.CI_BUILD_REF_NAME !== "master" + process.env.CI_COMMIT_REF_NAME && + process.env.CI_COMMIT_REF_NAME !== "master" ) { - version = process.env.CI_BUILD_REF_NAME; + version = process.env.CI_COMMIT_REF_NAME } - let buildRef = process.env.CI_BUILD_REF || "no-commit"; + let buildRef = process.env.CI_COMMIT_SHA || "no-commit"; let builtAt = $$("date +%s"); let ldFlags = `-X main.version=${version} -X main.builtAt=${builtAt} -X main.commit=${buildRef} -X main.target=${opts.target} -w -s`;