Skip to content

Commit

Permalink
Update release script to include all the libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
kurapov-peter committed May 10, 2023
1 parent 9c5b366 commit a2c5d9b
Showing 1 changed file with 36 additions and 13 deletions.
49 changes: 36 additions & 13 deletions scripts/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@

project_root_path = Path(os.path.dirname(os.path.realpath(__file__))).parent
print(project_root_path)
parser = argparse.ArgumentParser(description='Create release artifacts.')
parser = argparse.ArgumentParser(description="Create release artifacts.")
parser.add_argument(
'destination', help='Destination folder for the package.', type=Path)
parser.add_argument('version', help='Package version in x.x.x format.', type=str)
"destination", help="Destination folder for the package.", type=Path
)
parser.add_argument("version", help="Package version in x.x.x format.", type=str)

args = parser.parse_args()

Expand All @@ -21,22 +22,44 @@

Path(package_path).mkdir(parents=True, exist_ok=True)

subprocess.run(["cmake", "--install", ".", "--prefix", str(package_path)])


def get_artifact(config: str):
path = Path(tmpdirname + "/" + config)
path.mkdir()

subprocess.run(["cmake", "-DCMAKE_BUILD_TYPE=" + config,
"-S", project_root_path, "-B", str(path)])
subprocess.run(["cmake", "--build", str(path)])
subprocess.run(["cmake", "--install", str(path),
"--prefix", str(path) + "/install"])
subprocess.run(["tar", "-czvf", str(package_path / ("dbench-" +
package_version + "-" + config + ".tar.gz")), "-C", str(path) + "/install", "."])
env = os.environ.copy()
env["CXX"] = "clang++"

subprocess.run(
[
"cmake",
"-DCMAKE_BUILD_TYPE=" + config,
"-DENABLE_DPCPP=on",
"-DENABLE_CUDA=on",
"-S",
project_root_path,
"-B",
str(path),
],
env=env,
)
subprocess.run(["cmake", "--build", str(path)], env=env)
subprocess.run(
["cmake", "--install", str(path), "--prefix", str(path) + "/install"], env=env
)
subprocess.run(
[
"tar",
"-czvf",
str(
package_path / ("dbench-" + package_version + "-" + config + ".tar.gz")
),
"-C",
str(path) + "/install",
".",
]
)


with tempfile.TemporaryDirectory() as tmpdirname:
get_artifact("Debug")
get_artifact("Release")

0 comments on commit a2c5d9b

Please sign in to comment.