-
Notifications
You must be signed in to change notification settings - Fork 41
/
artifacts
29 lines (23 loc) · 1.13 KB
/
artifacts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
set -euo pipefail
#
# Generate zip artifacts for deno-lambda publishing.
#
# populate the cache from deno.land/x/lambda so we use the current files
mkdir -p .deno_dir/deps/https/deno.land/x/lambda/
cp mod.ts .deno_dir/deps/https/deno.land/x/lambda/mod.ts
cp types.d.ts .deno_dir/deps/https/deno.land/x/lambda/types.d.ts
# this shouldn't require a fetch to deno.land
DENO_DIR=.deno_dir ./bin/deno cache hello.ts
# assert the required files are going to be present in the zip
ls bin/deno &> /dev/null && ls bootstrap &> /dev/null && ls hello.ts &> /dev/null
cp -R .deno_dir/gen/file/$PWD/. .deno_dir/LAMBDA_TASK_ROOT
zip -qq deno-lambda-layer.zip -x '.deno_dir/gen/file/*' -r .deno_dir ./bin/deno bootstrap hello.ts
zip -qq deno-lambda-example.zip -x '.deno_dir/gen/file/*' -r .deno_dir hello.ts
DENO_DIR=.deno_dir ./bin/deno bundle hello.ts hello.bundle.js
rm -rf .deno_dir
mkdir -p .deno_dir/deps/https/deno.land/x/lambda/
cp mod.ts .deno_dir/deps/https/deno.land/x/lambda/mod.ts
DENO_DIR=.deno_dir ./bin/deno cache pad.ts
cp -R .deno_dir/gen/file/$PWD/. .deno_dir/LAMBDA_TASK_ROOT
zip -qq pad.zip -x '.deno_dir/gen/file/*' -r .deno_dir pad.ts