Skip to content

Commit 6ca1b7c

Browse files
committed
Convenience command to upload CI bundles
1 parent 31191fd commit 6ca1b7c

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

.github/workflows/ci.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import io
66
import os
77
import shlex
8+
import shutil
89
import subprocess
910
import sys
1011
import tarfile
@@ -43,7 +44,7 @@ def install_deps():
4344

4445

4546
def build_kitty():
46-
python = 'python3' if is_bundle else sys.executable
47+
python = shutil.which('python3') if is_bundle else sys.executable
4748
cmd = '{} setup.py build --verbose'.format(python)
4849
if os.environ.get('KITTY_SANITIZE') == '1':
4950
cmd += ' --debug --sanitize'
@@ -71,7 +72,7 @@ def replace_in_file(path, src, dest):
7172

7273
def setup_bundle_env():
7374
global SW
74-
os.environ['SW'] = SW = '/Users/Shared/buildbot/sw/sw' if is_macos else os.path.join(os.environ['GITHUB_WORKSPACE'], 'sw')
75+
os.environ['SW'] = SW = '/Users/Shared/kitty-build/sw/sw' if is_macos else os.path.join(os.environ['GITHUB_WORKSPACE'], 'sw')
7576
os.environ['PKG_CONFIG_PATH'] = SW + '/lib/pkgconfig'
7677
if is_macos:
7778
os.environ['PATH'] = '{}:{}'.format('/usr/local/opt/sphinx-doc/bin', os.environ['PATH'])
@@ -85,8 +86,8 @@ def install_bundle():
8586
cwd = os.getcwd()
8687
os.makedirs(SW)
8788
os.chdir(SW)
88-
with urlopen('https://download.calibre-ebook.com/travis/kitty/{}.tar.xz'.format(
89-
'osx' if is_macos else 'linux-64')) as f:
89+
with urlopen('https://download.calibre-ebook.com/ci/kitty/{}-64.tar.xz'.format(
90+
'macos' if is_macos else 'linux')) as f:
9091
data = f.read()
9192
with tarfile.open(fileobj=io.BytesIO(data), mode='r:xz') as tf:
9293
tf.extractall()

setup.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ def option_parser() -> argparse.ArgumentParser: # {{{
10451045
'action',
10461046
nargs='?',
10471047
default=Options.action,
1048-
choices='build test linux-package kitty.app linux-freeze macos-freeze build-launcher clean'.split(),
1048+
choices='build test linux-package kitty.app linux-freeze macos-freeze build-launcher clean export-ci-bundles'.split(),
10491049
help='Action to perform (default is build)'
10501050
)
10511051
p.add_argument(
@@ -1180,6 +1180,12 @@ def main() -> None:
11801180
build(args)
11811181
package(args, bundle_type='macos-package')
11821182
print('kitty.app successfully built!')
1183+
elif args.action == 'export-ci-bundles':
1184+
cmd = [sys.executable, '../bypy', 'export']
1185+
dest = ['download.calibre-ebook.com:/srv/download/ci/kitty']
1186+
subprocess.check_call(cmd + ['linux'] + dest)
1187+
subprocess.check_call(cmd + ['macos'] + dest)
1188+
subprocess.check_call(cmd + ['linux', '32'] + dest)
11831189

11841190

11851191
if __name__ == '__main__':

0 commit comments

Comments
 (0)