Convenience command to upload CI bundles
This commit is contained in:
parent
31191fd48c
commit
6ca1b7c240
9
.github/workflows/ci.py
vendored
9
.github/workflows/ci.py
vendored
@ -5,6 +5,7 @@
|
|||||||
import io
|
import io
|
||||||
import os
|
import os
|
||||||
import shlex
|
import shlex
|
||||||
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import tarfile
|
import tarfile
|
||||||
@ -43,7 +44,7 @@ def install_deps():
|
|||||||
|
|
||||||
|
|
||||||
def build_kitty():
|
def build_kitty():
|
||||||
python = 'python3' if is_bundle else sys.executable
|
python = shutil.which('python3') if is_bundle else sys.executable
|
||||||
cmd = '{} setup.py build --verbose'.format(python)
|
cmd = '{} setup.py build --verbose'.format(python)
|
||||||
if os.environ.get('KITTY_SANITIZE') == '1':
|
if os.environ.get('KITTY_SANITIZE') == '1':
|
||||||
cmd += ' --debug --sanitize'
|
cmd += ' --debug --sanitize'
|
||||||
@ -71,7 +72,7 @@ def replace_in_file(path, src, dest):
|
|||||||
|
|
||||||
def setup_bundle_env():
|
def setup_bundle_env():
|
||||||
global SW
|
global SW
|
||||||
os.environ['SW'] = SW = '/Users/Shared/buildbot/sw/sw' if is_macos else os.path.join(os.environ['GITHUB_WORKSPACE'], 'sw')
|
os.environ['SW'] = SW = '/Users/Shared/kitty-build/sw/sw' if is_macos else os.path.join(os.environ['GITHUB_WORKSPACE'], 'sw')
|
||||||
os.environ['PKG_CONFIG_PATH'] = SW + '/lib/pkgconfig'
|
os.environ['PKG_CONFIG_PATH'] = SW + '/lib/pkgconfig'
|
||||||
if is_macos:
|
if is_macos:
|
||||||
os.environ['PATH'] = '{}:{}'.format('/usr/local/opt/sphinx-doc/bin', os.environ['PATH'])
|
os.environ['PATH'] = '{}:{}'.format('/usr/local/opt/sphinx-doc/bin', os.environ['PATH'])
|
||||||
@ -85,8 +86,8 @@ def install_bundle():
|
|||||||
cwd = os.getcwd()
|
cwd = os.getcwd()
|
||||||
os.makedirs(SW)
|
os.makedirs(SW)
|
||||||
os.chdir(SW)
|
os.chdir(SW)
|
||||||
with urlopen('https://download.calibre-ebook.com/travis/kitty/{}.tar.xz'.format(
|
with urlopen('https://download.calibre-ebook.com/ci/kitty/{}-64.tar.xz'.format(
|
||||||
'osx' if is_macos else 'linux-64')) as f:
|
'macos' if is_macos else 'linux')) as f:
|
||||||
data = f.read()
|
data = f.read()
|
||||||
with tarfile.open(fileobj=io.BytesIO(data), mode='r:xz') as tf:
|
with tarfile.open(fileobj=io.BytesIO(data), mode='r:xz') as tf:
|
||||||
tf.extractall()
|
tf.extractall()
|
||||||
|
|||||||
8
setup.py
8
setup.py
@ -1045,7 +1045,7 @@ def option_parser() -> argparse.ArgumentParser: # {{{
|
|||||||
'action',
|
'action',
|
||||||
nargs='?',
|
nargs='?',
|
||||||
default=Options.action,
|
default=Options.action,
|
||||||
choices='build test linux-package kitty.app linux-freeze macos-freeze build-launcher clean'.split(),
|
choices='build test linux-package kitty.app linux-freeze macos-freeze build-launcher clean export-ci-bundles'.split(),
|
||||||
help='Action to perform (default is build)'
|
help='Action to perform (default is build)'
|
||||||
)
|
)
|
||||||
p.add_argument(
|
p.add_argument(
|
||||||
@ -1180,6 +1180,12 @@ def main() -> None:
|
|||||||
build(args)
|
build(args)
|
||||||
package(args, bundle_type='macos-package')
|
package(args, bundle_type='macos-package')
|
||||||
print('kitty.app successfully built!')
|
print('kitty.app successfully built!')
|
||||||
|
elif args.action == 'export-ci-bundles':
|
||||||
|
cmd = [sys.executable, '../bypy', 'export']
|
||||||
|
dest = ['download.calibre-ebook.com:/srv/download/ci/kitty']
|
||||||
|
subprocess.check_call(cmd + ['linux'] + dest)
|
||||||
|
subprocess.check_call(cmd + ['macos'] + dest)
|
||||||
|
subprocess.check_call(cmd + ['linux', '32'] + dest)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user