# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation and Dapr Contributors. # Licensed under the MIT License. # ------------------------------------------------------------ # This script parses release version from Git tag and set the parsed version to # environment variable, REL_VERSION. If the tag is the final version, it sets import os import sys gitRef = os.getenv("GITHUB_REF") tagRefPrefix = "refs/tags/v" with open(os.getenv("GITHUB_ENV"), "a") as githubEnv: if gitRef is None or not gitRef.startswith(tagRefPrefix): githubEnv.write("REL_VERSION=latest\n") print ("This is daily build from {}...".format(gitRef)) sys.exit(0) releaseVersion = gitRef[len(tagRefPrefix):] githubEnv.write("REL_VERSION={}\n".format(releaseVersion))