Skip to content

Commit 9f79450

Browse files
committed
Fix self-publish script.
1 parent 1363484 commit 9f79450

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

publish.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import os
66
import re
77
import subprocess
8+
import time
89
import urllib.request
910
from urllib.error import HTTPError
1011

@@ -32,17 +33,20 @@ def maybe_publish(path):
3233
version = re.search('^version = "([^"]+)"', content, re.M).group(1)
3334
if already_published(name, version):
3435
print('%s %s is already published, skipping' % (name, version))
35-
return
36+
return False
3637
subprocess.check_call(['cargo', 'publish', '--no-verify'], cwd=path)
38+
return True
3739

3840

3941
def main():
40-
print('Doing dry run first...')
41-
for path in TO_PUBLISH:
42-
subprocess.check_call(['cargo', 'publish', '--no-verify', '--dry-run'], cwd=path)
4342
print('Starting publish...')
44-
for path in TO_PUBLISH:
45-
maybe_publish(path)
43+
for i, path in enumerate(TO_PUBLISH):
44+
if maybe_publish(path):
45+
if i < len(TO_PUBLISH)-1:
46+
# Sleep to allow the index to update. This should probably
47+
# check that the index is updated, or use a retry loop
48+
# instead.
49+
time.sleep(5)
4650
print('Publish complete!')
4751

4852

0 commit comments

Comments
 (0)