summaryrefslogtreecommitdiff
path: root/tools/cargo_publish.py
diff options
context:
space:
mode:
authorRy Dahl <ry@tinyclouds.org>2020-01-17 17:53:13 -0500
committerGitHub <noreply@github.com>2020-01-17 17:53:13 -0500
commitd7203092039d3c46ca8480ff8eecf612deb2b2f6 (patch)
treeb247e948bc65d710f6e86d995aca9c20089cf728 /tools/cargo_publish.py
parent35eb79610f4b451af1d4a9c286fd63875d28bca5 (diff)
Auto cargo-publish on tags (#3704)
fix tools/cargo_publish.py
Diffstat (limited to 'tools/cargo_publish.py')
-rwxr-xr-xtools/cargo_publish.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/cargo_publish.py b/tools/cargo_publish.py
new file mode 100755
index 000000000..b8fa1f037
--- /dev/null
+++ b/tools/cargo_publish.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+import os
+import sys
+import argparse
+from util import run, root_path
+
+
+def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--dry-run", action="store_true")
+ args = parser.parse_args()
+
+ cargo_publish = ["cargo", "publish"]
+ if args.dry_run:
+ cargo_publish += ["--dry-run"]
+
+ os.chdir(os.path.join(root_path, "core"))
+ run(cargo_publish)
+
+ os.chdir(os.path.join(root_path, "deno_typescript"))
+ run(cargo_publish)
+
+ os.chdir(os.path.join(root_path, "cli"))
+ run(cargo_publish)
+
+
+if __name__ == '__main__':
+ sys.exit(main())