Fetch pgp keys before upgrading packages
To avoid any ABI bump breaking pgp
This commit is contained in:
parent
84315e8e56
commit
745e5e2c40
136
autobuild.py
136
autobuild.py
@ -532,78 +532,78 @@ def build_package(build_type: BuildType, pkg: Package, msys2_root: _PathLike, bu
|
|||||||
|
|
||||||
repo = get_main_repo()
|
repo = get_main_repo()
|
||||||
|
|
||||||
with staging_dependencies(build_type, pkg, msys2_root, builddir), \
|
with fresh_git_repo(pkg['repo_url'], repo_dir):
|
||||||
fresh_git_repo(pkg['repo_url'], repo_dir):
|
|
||||||
pkg_dir = os.path.join(repo_dir, pkg['repo_path'])
|
pkg_dir = os.path.join(repo_dir, pkg['repo_path'])
|
||||||
|
|
||||||
try:
|
# Fetch all keys mentioned in the PKGBUILD
|
||||||
# Fetch all keys mentioned in the PKGBUILD
|
validpgpkeys = to_pure_posix_path(os.path.join(SCRIPT_DIR, 'fetch-validpgpkeys.sh'))
|
||||||
validpgpkeys = to_pure_posix_path(os.path.join(SCRIPT_DIR, 'fetch-validpgpkeys.sh'))
|
run_cmd(msys2_root, ['bash', validpgpkeys], cwd=pkg_dir)
|
||||||
run_cmd(msys2_root, ['bash', validpgpkeys], cwd=pkg_dir)
|
|
||||||
|
|
||||||
env = get_build_environ()
|
with staging_dependencies(build_type, pkg, msys2_root, builddir):
|
||||||
if build_type == "mingw-src":
|
try:
|
||||||
env['MINGW_ARCH'] = Config.MINGW_SRC_ARCH
|
env = get_build_environ()
|
||||||
run_cmd(msys2_root, [
|
if build_type == "mingw-src":
|
||||||
'makepkg-mingw',
|
env['MINGW_ARCH'] = Config.MINGW_SRC_ARCH
|
||||||
'--noconfirm',
|
run_cmd(msys2_root, [
|
||||||
'--noprogressbar',
|
'makepkg-mingw',
|
||||||
'--allsource'
|
'--noconfirm',
|
||||||
], env=env, cwd=pkg_dir)
|
'--noprogressbar',
|
||||||
elif build_type == "msys-src":
|
'--allsource'
|
||||||
run_cmd(msys2_root, [
|
], env=env, cwd=pkg_dir)
|
||||||
'makepkg',
|
elif build_type == "msys-src":
|
||||||
'--noconfirm',
|
run_cmd(msys2_root, [
|
||||||
'--noprogressbar',
|
'makepkg',
|
||||||
'--allsource'
|
'--noconfirm',
|
||||||
], env=env, cwd=pkg_dir)
|
'--noprogressbar',
|
||||||
elif build_type in Config.MINGW_ARCH_LIST:
|
'--allsource'
|
||||||
env['MINGW_ARCH'] = build_type
|
], env=env, cwd=pkg_dir)
|
||||||
run_cmd(msys2_root, [
|
elif build_type in Config.MINGW_ARCH_LIST:
|
||||||
'makepkg-mingw',
|
env['MINGW_ARCH'] = build_type
|
||||||
'--noconfirm',
|
run_cmd(msys2_root, [
|
||||||
'--noprogressbar',
|
'makepkg-mingw',
|
||||||
'--nocheck',
|
'--noconfirm',
|
||||||
'--syncdeps',
|
'--noprogressbar',
|
||||||
'--rmdeps',
|
'--nocheck',
|
||||||
'--cleanbuild'
|
'--syncdeps',
|
||||||
], env=env, cwd=pkg_dir)
|
'--rmdeps',
|
||||||
elif build_type == "msys":
|
'--cleanbuild'
|
||||||
run_cmd(msys2_root, [
|
], env=env, cwd=pkg_dir)
|
||||||
'makepkg',
|
elif build_type == "msys":
|
||||||
'--noconfirm',
|
run_cmd(msys2_root, [
|
||||||
'--noprogressbar',
|
'makepkg',
|
||||||
'--nocheck',
|
'--noconfirm',
|
||||||
'--syncdeps',
|
'--noprogressbar',
|
||||||
'--rmdeps',
|
'--nocheck',
|
||||||
'--cleanbuild'
|
'--syncdeps',
|
||||||
], env=env, cwd=pkg_dir)
|
'--rmdeps',
|
||||||
|
'--cleanbuild'
|
||||||
|
], env=env, cwd=pkg_dir)
|
||||||
|
else:
|
||||||
|
assert 0
|
||||||
|
|
||||||
|
entries = os.listdir(pkg_dir)
|
||||||
|
for pattern in pkg.get_build_patterns(build_type):
|
||||||
|
found = fnmatch.filter(entries, pattern)
|
||||||
|
if not found:
|
||||||
|
raise BuildError(f"{pattern} not found, likely wrong version built")
|
||||||
|
to_upload.extend([os.path.join(pkg_dir, e) for e in found])
|
||||||
|
|
||||||
|
except (subprocess.CalledProcessError, BuildError) as e:
|
||||||
|
wait_for_api_limit_reset()
|
||||||
|
release = get_release(repo, "staging-failed")
|
||||||
|
run_urls = get_current_run_urls()
|
||||||
|
failed_data = {}
|
||||||
|
if run_urls is not None:
|
||||||
|
failed_data["urls"] = run_urls
|
||||||
|
content = json.dumps(failed_data).encode()
|
||||||
|
upload_asset(release, pkg.get_failed_name(build_type), text=True, content=content)
|
||||||
|
|
||||||
|
raise BuildError(e)
|
||||||
else:
|
else:
|
||||||
assert 0
|
wait_for_api_limit_reset()
|
||||||
|
release = repo.get_release("staging-" + build_type)
|
||||||
entries = os.listdir(pkg_dir)
|
for path in to_upload:
|
||||||
for pattern in pkg.get_build_patterns(build_type):
|
upload_asset(release, path)
|
||||||
found = fnmatch.filter(entries, pattern)
|
|
||||||
if not found:
|
|
||||||
raise BuildError(f"{pattern} not found, likely wrong version built")
|
|
||||||
to_upload.extend([os.path.join(pkg_dir, e) for e in found])
|
|
||||||
|
|
||||||
except (subprocess.CalledProcessError, BuildError) as e:
|
|
||||||
wait_for_api_limit_reset()
|
|
||||||
release = get_release(repo, "staging-failed")
|
|
||||||
run_urls = get_current_run_urls()
|
|
||||||
failed_data = {}
|
|
||||||
if run_urls is not None:
|
|
||||||
failed_data["urls"] = run_urls
|
|
||||||
content = json.dumps(failed_data).encode()
|
|
||||||
upload_asset(release, pkg.get_failed_name(build_type), text=True, content=content)
|
|
||||||
|
|
||||||
raise BuildError(e)
|
|
||||||
else:
|
|
||||||
wait_for_api_limit_reset()
|
|
||||||
release = repo.get_release("staging-" + build_type)
|
|
||||||
for path in to_upload:
|
|
||||||
upload_asset(release, path)
|
|
||||||
|
|
||||||
|
|
||||||
def run_build(args: Any) -> None:
|
def run_build(args: Any) -> None:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user