Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix self-publish script. #8492

Merged
merged 1 commit into from
Jul 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import re
import subprocess
import time
import urllib.request
from urllib.error import HTTPError

Expand Down Expand Up @@ -32,17 +33,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!')


Expand Down