snpeff: use update_on to get SnpSift version (#190)

This commit is contained in:
pekkarr 2023-10-03 13:32:57 +03:00 committed by GitHub
parent dca81d6702
commit 6b680fca96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 18 deletions

View file

@ -1,23 +1,10 @@
#!/usr/bin/env python3
import requests
import fileinput
from lilaclib import *
def get_latest_tag(owner, repo):
url = f"https://api.github.com/repos/{owner}/{repo}/tags"
response = requests.get(url)
response.raise_for_status()
tags = response.json()
latest_tag = tags[0]["name"].lstrip("v")
return latest_tag
def pre_build():
latest_tag = get_latest_tag("pcingola", "SnpSift")
for line in edit_file('PKGBUILD'):
if line.startswith('_pkgver2='):
current_tag = line.split("=")[1].strip()
if latest_tag > current_tag:
line = f'_pkgver2={latest_tag}'
line = f'_pkgver2={_G.newvers[1]}'
print(line)
update_pkgver_and_pkgrel(_G.newver.lstrip('v'))
update_pkgver_and_pkgrel(_G.newver)

View file

@ -2,8 +2,6 @@ maintainers:
- github: kbipinkumar
email: kbipinkumar@pm.me
build_prefix: extra-x86_64
pre_build_script: |
run_cmd(['updpkgsums'])
post_build_script: |
git_pkgbuild_commit()
update_aur_repo()
@ -11,4 +9,8 @@ update_on:
- source: github
github: pcingola/SnpEff
use_max_tag: true
prefix: 'v'
prefix: v
- source: github
github: pcingola/SnpSift
use_max_tag: true
prefix: v