Skip to content

Commit

Permalink
Merge pull request #496 from betrusted-io/fix-publish
Browse files Browse the repository at this point in the history
upgrade the publish script to maintain remote sha2 crate
  • Loading branch information
bunnie authored Feb 1, 2024
2 parents 71d3800 + c370a01 commit c3ff947
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,20 +249,23 @@ def main():
print("Can't simultaneously change to local and remote paths. Pick only one operation.")
exit(1)

crate_roots = ['.', '../hashes/sha2']

if args.bump or args.local_paths or args.remote_paths:
cargo_toml_paths = []
for path in Path('.').rglob('Cargo.toml'):
if 'target' not in str(path):
not_core_path = True
for cratespec in cratelist:
editpath = cratespec[1]
normpath = str(Path(path)).replace('\\', '/').rpartition('/')[0] # fix windows paths
# print(editpath)
# print(normpath)
if editpath == normpath:
not_core_path = False
if not_core_path:
cargo_toml_paths += [path]
for roots in crate_roots:
for path in Path(roots).rglob('Cargo.toml'):
if 'target' not in str(path):
not_core_path = True
for cratespec in cratelist:
editpath = cratespec[1]
normpath = str(Path(path)).replace('\\', '/').rpartition('/')[0] # fix windows paths
# print(editpath)
# print(normpath)
if editpath == normpath:
not_core_path = False
if not_core_path:
cargo_toml_paths += [path]

# import pprint
# pp = pprint.PrettyPrinter(indent=2)
Expand Down Expand Up @@ -333,6 +336,10 @@ def main():
print("Retry failed, moving on anyways...")
time.sleep(1)

print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
print("Don't forget to manually push alternate crate roots to github: {}".format(crate_roots[1:]))
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")

if __name__ == "__main__":
main()
exit(0)

0 comments on commit c3ff947

Please sign in to comment.