Skip to content

Commit

Permalink
Git pull before pushing and allow release error bypass
Browse files Browse the repository at this point in the history
Signed-off-by: Chaichontat Sriworarat <[email protected]>
  • Loading branch information
chaichontat committed Nov 13, 2024
1 parent 2d6e7fa commit 9659bc4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions laminci/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ def publish_github_release(
print(f"\nrun: {' '.join(command)}")
subprocess.run(command, check=True, stdout=subprocess.PIPE, cwd=cwd)
except (subprocess.CalledProcessError, FileNotFoundError) as e:
raise SystemExit(f"Error creating GitHub release using `gh`: {e}")
if input("GitHub release error. Continue? ") != "y":
raise e
except (subprocess.CalledProcessError, FileNotFoundError):
try:
from github import Github, GithubException
Expand Down Expand Up @@ -195,6 +196,7 @@ def main():
commands = [
"git add -u",
f"git commit -m 'Release {version}'",
"git pull",
"git push",
f"git tag {version}",
f"git push origin {version}",
Expand All @@ -208,7 +210,7 @@ def main():
if args.changelog is not None
else "https://docs.lamin.ai/changelog"
)

# breakpoint()
publish_github_release(
repo_name=f"laminlabs/{repo_name}",
version=version,
Expand Down

0 comments on commit 9659bc4

Please sign in to comment.