]> git.proxmox.com Git - cargo.git/blobdiff - publish.py
fix: add periods to list items
[cargo.git] / publish.py
index 01bdf37cd650afa56e4063d6f9c683780253565d..5ace18f7282ea545b26a1b045eb1a527f1068da0 100755 (executable)
@@ -5,12 +5,14 @@
 import os
 import re
 import subprocess
+import time
 import urllib.request
 from urllib.error import HTTPError
 
 
 TO_PUBLISH = [
     'crates/cargo-platform',
+    'crates/cargo-util',
     'crates/crates-io',
     '.',
 ]
@@ -32,17 +34,20 @@ def maybe_publish(path):
     version = re.search('^version = "([^"]+)"', content, re.M).group(1)
     if already_published(name, version):
         print('%s %s is already published, skipping' % (name, version))
-        return
+        return False
     subprocess.check_call(['cargo', 'publish', '--no-verify'], cwd=path)
+    return True
 
 
 def main():
-    print('Doing dry run first...')
-    for path in TO_PUBLISH:
-        subprocess.check_call(['cargo', 'publish', '--no-verify', '--dry-run'], cwd=path)
     print('Starting publish...')
-    for path in TO_PUBLISH:
-        maybe_publish(path)
+    for i, path in enumerate(TO_PUBLISH):
+        if maybe_publish(path):
+            if i < len(TO_PUBLISH)-1:
+                # Sleep to allow the index to update. This should probably
+                # check that the index is updated, or use a retry loop
+                # instead.
+                time.sleep(5)
     print('Publish complete!')