Skip to content

Commit 36bd76d

Browse files
committed
Convenience command to upload CI bundles
1 parent 31191fd commit 36bd76d

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

.github/workflows/ci.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import subprocess
99
import sys
1010
import tarfile
11+
import shutil
1112
from urllib.request import urlopen
1213

1314
is_bundle = os.environ.get('KITTY_BUNDLE') == '1'
@@ -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'
@@ -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)