From 5a3fed8f8b735b87acf76f3f0cc2ab59e53f47ac Mon Sep 17 00:00:00 2001 From: Sudo-Ivan Date: Mon, 29 Dec 2025 21:58:33 -0600 Subject: [PATCH] Add tasks for gosec security scanning and WebAssembly builds in Taskfile.yml --- Taskfile.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Taskfile.yml b/Taskfile.yml index 887fb96..373e2c5 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -69,6 +69,11 @@ tasks: cmds: - revive -config revive.toml -formatter friendly ./pkg/* ./cmd/* ./internal/* + scan: + desc: Run gosec security scanner + cmds: + - gosec ./... + check: desc: Run fmt-check, vet, and lint deps: [fmt-check, vet, lint] @@ -161,6 +166,33 @@ tasks: - mkdir -p {{.BUILD_DIR}} - tinygo build -target wasm -o {{.BUILD_DIR}}/{{.BINARY_NAME}}.wasm {{.MAIN_PACKAGE}} + build-wasm: + desc: Build WebAssembly binary with standard Go compiler + env: + CGO_ENABLED: '0' + cmds: + - mkdir -p {{.BUILD_DIR}} + - 'GOOS=js GOARCH=wasm {{.GOCMD}} build -o {{.BUILD_DIR}}/{{.BINARY_NAME}}.wasm {{.MAIN_PACKAGE}}' + - mkdir -p examples/wasm/static + - cp {{.BUILD_DIR}}/{{.BINARY_NAME}}.wasm examples/wasm/static/reticulum-go.wasm + + build-wasm-example: + desc: Build WebAssembly example + env: + CGO_ENABLED: '0' + cmds: + - mkdir -p examples/wasm/static + - 'cd examples/wasm && GOOS=js GOARCH=wasm {{.GOCMD}} build -o static/reticulum-go.wasm .' + - | + GOROOT=$({{.GOCMD}} env GOROOT) + if [ -f "$GOROOT/misc/wasm/wasm_exec.js" ]; then + cp "$GOROOT/misc/wasm/wasm_exec.js" examples/wasm/ + echo "wasm_exec.js copied successfully" + else + echo "Warning: wasm_exec.js not found at $GOROOT/misc/wasm/wasm_exec.js" + echo "Please copy it manually to examples/wasm/" + fi + install: desc: Install dependencies cmds: