Skip to content

Commit f77cea6

Browse files
committed
Tune build and upload artifact in GitHub Action workflow
1 parent fee7b9f commit f77cea6

File tree

4 files changed

+174
-5
lines changed

4 files changed

+174
-5
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,9 @@ jobs:
2121
- run: npx esbuild --bundle src/app.ts --tree-shaking=true --format=esm --target=es2020 --outfile=out.js
2222
- run: ./javy-x86_64-linux-v1.2.0 compile out.js -o examples/plugin.wasm
2323
- run: sqlc -f sqlc.dev.yaml diff
24-
working-directory: examples
24+
working-directory: examples
25+
- uses: actions/upload-artifact@v4
26+
with:
27+
name: plugin
28+
path: examples/plugin.wasm
29+
overwrite: true

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ out.js
33
*.wasm
44
javy
55
tests
6+
/javy-x86_64-linux-v1.2.0
7+
/javy-x86_64-linux-v1.2.0.gz
8+
/bin/javy

Makefile

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,26 @@ generate: examples/plugin.wasm examples/sqlc.dev.yaml
44
cd examples && sqlc-dev -f sqlc.dev.yaml generate
55

66
# https://github.com/bytecodealliance/javy/releases/tag/v1.2.0
7-
examples/plugin.wasm: out.js
8-
./javy compile out.js -o examples/plugin.wasm
7+
examples/plugin.wasm: out.js bin/javy
8+
./bin/javy compile out.js -o examples/plugin.wasm
99

10-
out.js: src/app.ts $(wildcard src/drivers/*.ts) src/gen/plugin/codegen_pb.ts
10+
out.js: src/app.ts $(wildcard src/drivers/*.ts) src/gen/plugin/codegen_pb.ts node_modules
1111
npx tsc --noEmit
1212
npx esbuild --bundle src/app.ts --tree-shaking=true --format=esm --target=es2020 --outfile=out.js
1313

1414
src/gen/plugin/codegen_pb.ts: buf.gen.yaml
1515
buf generate --template buf.gen.yaml buf.build/sqlc/sqlc --path plugin/
16+
17+
node_modules: package.json package-lock.json
18+
npm install
19+
20+
bin/javy:
21+
wget https://github.com/bytecodealliance/javy/releases/download/v1.2.0/javy-x86_64-linux-v1.2.0.gz
22+
gunzip --force javy-x86_64-linux-v1.2.0.gz
23+
install -Dpv javy-x86_64-linux-v1.2.0 bin/javy
24+
25+
clean:
26+
$(RM) -r out.js
27+
$(RM) -r examples/plugin.wasm
28+
$(RM) -r node_modules
29+
$(RM) -r bin/javy javy-x86_64-linux-v1.2.0 javy-x86_64-linux-v1.2.0.gz

package-lock.json

Lines changed: 148 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)