comparison tasks.py @ 133:8a30f1c9a702

trying to build a runnable dist
author drewp@bigasterisk.com
date Sat, 06 May 2023 14:10:55 -0700
parents 73a70d00fb74
children a6490559ce73
comparison
equal deleted inserted replaced
132:828a64e62e73 133:8a30f1c9a702
41 print(" ^^ commit these diffs first") 41 print(" ^^ commit these diffs first")
42 return 42 return
43 v = ctx.run('pnpm version minor').stdout.strip() 43 v = ctx.run('pnpm version minor').stdout.strip()
44 ctx.run(f'hg commit --message "release {v}"') 44 ctx.run(f'hg commit --message "release {v}"')
45 build(ctx) 45 build(ctx)
46 install_to_bigasterisk_lib(ctx, 'streamed-graph.js',
47 f'lib/streamed-graph/{v}/')
48 # this fails with ENEEDAUTH:
49 #ctx.run(f'pnpm publish --registry https://bigasterisk.com/js', pty=True)
50
51
52 def install_to_bigasterisk_lib(ctx, distFile, libPath):
46 filesRoot = '/my/site/homepage/newsrc/files' 53 filesRoot = '/my/site/homepage/newsrc/files'
47 path = f'lib/streamed-graph/{v}/' 54 outdir = f'{filesRoot}/{libPath}'
48 outdir = f'{filesRoot}/{path}'
49 name = 'streamed-graph.es.js'
50 ctx.run(f'mkdir -p {outdir}') 55 ctx.run(f'mkdir -p {outdir}')
51 ctx.run(f'cp dist/{name} {outdir}') 56 ctx.run(f'cp dist/{distFile} {outdir}')
57 print('rebuild bigasterisk:')
52 ctx.run('cd /my/site/homepage; inv build') 58 ctx.run('cd /my/site/homepage; inv build')
53 ctx.run( 59 ctx.run(
54 "curl -s -o/dev/null -w '%{url_effective} %{http_code} bytes=%{size_download}\n' " 60 "curl -s -o/dev/null -w '%{url_effective} %{http_code} bytes=%{size_download}\n' "
55 + "https://bigasterisk.com/" + path + name, 61 + "https://bigasterisk.com/" + libPath + distFile,
56 pty=True) 62 pty=True)
57 # this fails with ENEEDAUTH:
58 #ctx.run(f'pnpm publish --registry https://bigasterisk.com/js', pty=True)
59 63
60 64
61 @task 65 @task
62 def dev(ctx): 66 def dev(ctx):
63 ctx.run('pnpm dev') 67 ctx.run('pnpm dev')