macos.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. import os
  10. from pathlib import Path
  11. from ci import tarball_uploader
  12. from materialize import spawn
  13. from materialize.xcompile import Arch
  14. from ..deploy.deploy_util import rust_version
  15. from . import deploy_util
  16. def main() -> None:
  17. target = f"{Arch.host()}-apple-darwin"
  18. print("--- Building mz release binary")
  19. spawn.runv(
  20. ["cargo", "build", "--bin", "mz", "--release"],
  21. env=dict(os.environ, RUSTUP_TOOLCHAIN=rust_version()),
  22. )
  23. print(f"--- Uploading {target} binary tarball")
  24. uploader = tarball_uploader.TarballUploader(
  25. package_name="mz",
  26. version=deploy_util.MZ_CLI_VERSION,
  27. )
  28. uploader.deploy_tarball(target, Path("target") / "release" / "mz")
  29. if __name__ == "__main__":
  30. main()