feat: get links from gitlab releases

This commit is contained in:
Swann Martinez
2020-03-12 11:40:36 +01:00
parent 08b9a35981
commit 1c6e88ce61

View File

@ -1624,6 +1624,9 @@ class GitlabEngine(object):
return "{}{}{}".format(self.api_url,"/api/v4/projects/",updater.repo)
def form_tags_url(self, updater):
if updater.use_releases:
return "{}{}".format(self.form_repo_url(updater),"/releases")
else:
return "{}{}".format(self.form_repo_url(updater),"/repository/tags")
def form_branch_list_url(self, updater):
@ -1652,7 +1655,8 @@ class GitlabEngine(object):
def parse_tags(self, response, updater):
if response == None:
return []
return [{"name": tag["name"], "zipball_url": self.get_zip_url(tag["commit"]["id"], updater)} for tag in response]
# Return asset links from release
return [{"name": tag["name"], "zipball_url": tag["assets"]["links"][0]["url"]} for tag in response]
# -----------------------------------------------------------------------------